fix(shader,gpu): add CBV size guards, bit-exact typed views, dot-product lowering, and POPS ROVs #3546

Open
github-bot wants to merge 1 commit from github-bot/gh-3546 into main AGit
Owner

@⁠legayclightning22 on GitHub · 2026-11-27 16:42 UTC · original
legayclightning22:fix/nvidia-cbv-typed-views-dot-and-pops → main · +699 −70 · 6 files · 1 commits · open

Summary

Adds CBV size clamping (<= 65,536 bytes) and zero-size CBV safety, bit-exact typed buffer format mapping, packed GFX10 dot-product lowering (emit/dot.rs), and POPS ordered-RW (ROV) detection (8fb4c08c, +699/-70).

Verification

  • cargo test --locked -p victory-shader --lib and cargo test --locked -p victory-gpu --lib
  • cargo clippy --locked -p victory-shader -p victory-gpu --all-targets --all-features -- -D warnings
  • cargo xtask policy
**@⁠legayclightning22** on GitHub · 2026-11-27 16:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/3546) `legayclightning22:fix/nvidia-cbv-typed-views-dot-and-pops` → `main` · +699 −70 · 6 files · 1 commits · open ## Summary Adds CBV size clamping (`<= 65,536` bytes) and zero-size CBV safety, bit-exact typed buffer format mapping, packed GFX10 dot-product lowering (`emit/dot.rs`), and POPS ordered-RW (ROV) detection (`8fb4c08c`, `+699/-70`). ## Verification - `cargo test --locked -p victory-shader --lib` and `cargo test --locked -p victory-gpu --lib` - `cargo clippy --locked -p victory-shader -p victory-gpu --all-targets --all-features -- -D warnings` - `cargo xtask policy`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 16:47:07 +00:00
github-bot force-pushed github-bot/gh-3546 from 8fb4c00c77 to 26923a02d3 2026-11-27 17:05:20 +00:00 Compare
Author
Owner

@⁠kilolimaVI on GitHub · 2026-11-27 17:59 UTC · original · reviewed

AMD check, head 26923a0: Windows 11, Radeon 780M (RDNA3 iGPU), toolchain 1.98.1.

Since dot products are where an AMD driver issue already bit (#1782, constant multiplicands zero-extended), I ran them on hardware:

  • dot tests: 5 passed, including main's fspx_programs_run_with_the_hardwares_dot_products and byte_dot_products_match_the_hardware (hardware + WARP).
  • semantics_tests: 481 probes, 0 model mismatches and 0 hardware/WARP differences.
  • cargo test -p victory-shader on the 780M: 305 passed, 0 failed.

So the new dot.rs keeps RDNA3 bit-exact and doesn't reintroduce #1782.

AI-assisted (Claude).

**@⁠kilolimaVI** on GitHub · 2026-11-27 17:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/3546#pullrequestreview-6091822672) · **reviewed** AMD check, head 26923a0: Windows 11, Radeon 780M (RDNA3 iGPU), toolchain 1.98.1. Since dot products are where an AMD driver issue already bit (#1782, constant multiplicands zero-extended), I ran them on hardware: - `dot` tests: 5 passed, including main's `fspx_programs_run_with_the_hardwares_dot_products` and `byte_dot_products_match_the_hardware` (hardware + WARP). - `semantics_tests`: 481 probes, 0 model mismatches and 0 hardware/WARP differences. - `cargo test -p victory-shader` on the 780M: 305 passed, 0 failed. So the new `dot.rs` keeps RDNA3 bit-exact and doesn't reintroduce #1782. AI-assisted (Claude).
Author
Owner

@⁠Jishnuraj07 on GitHub · 2026-11-27 18:19 UTC · original

Tested on an NVIDIA RTX 5060 8 GB, driver 32.0.16.2112, Windows 11 Pro 10.0.26200, rustc 1.98.1 (MSVC), base main 63bcca4.

At the previous head 8fb4c00, host_constant_views_clamp_and_zero failed (constant_view_size(0) returned 0, expected 256). At the current head 26923a0 (size.max(256)) it passes:

main 63bcca4 8fb4c00 26923a0
clippy -p victory-gpu -p victory-shader --all-targets -D warnings clean clean –
victory-gpu --lib 229 passed, 2 failed 232 passed, 3 failed 233 passed, 2 failed
victory-shader --lib -- --test-threads=1 --skip heap_direct_texture_reads_mark_their_heap_index 298 passed, 3 failed 301 passed, 3 failed –

The two victory-gpu failures left are the capped-heap pair main also fails on this card (#3445). The three victory-shader failures are the same three as on main here, with the same output (#3445). The skipped test crashes the test binary on main too. For 26923a0 I re-ran only victory-gpu, since the change is in descriptor.rs alone.

One small thing is still there: the doc comment above constant_view_size in descriptor.rs ("Device method. A null desc writes a null CBV…") describes create_cbv, not this function.

**@⁠Jishnuraj07** on GitHub · 2026-11-27 18:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/3546#issuecomment-7225365530) Tested on an **NVIDIA RTX 5060 8 GB, driver 32.0.16.2112, Windows 11 Pro 10.0.26200**, rustc 1.98.1 (MSVC), base `main` `63bcca4`. At the previous head `8fb4c00`, `host_constant_views_clamp_and_zero` failed (`constant_view_size(0)` returned 0, expected 256). At the current head `26923a0` (`size.max(256)`) it passes: | | `main` 63bcca4 | `8fb4c00` | `26923a0` | |---|---|---|---| | clippy `-p victory-gpu -p victory-shader --all-targets -D warnings` | clean | clean | – | | `victory-gpu --lib` | 229 passed, 2 failed | 232 passed, 3 failed | **233 passed, 2 failed** | | `victory-shader --lib -- --test-threads=1 --skip heap_direct_texture_reads_mark_their_heap_index` | 298 passed, 3 failed | 301 passed, 3 failed | – | The two `victory-gpu` failures left are the capped-heap pair `main` also fails on this card (#3445). The three `victory-shader` failures are the same three as on `main` here, with the same output (#3445). The skipped test crashes the test binary on `main` too. For `26923a0` I re-ran only `victory-gpu`, since the change is in `descriptor.rs` alone. One small thing is still there: the doc comment above `constant_view_size` in `descriptor.rs` ("Device method. A null `desc` writes a null CBV…") describes `create_cbv`, not this function.
Author
Owner

@⁠oddmaniv on GitHub · 2026-11-27 18:22 UTC · original

Independent verification of the PR author's shader-package parser tests at 26923a02d3bd981fa9c26d31ba596430fbb04732.

cargo test --locked -p victory-game --lib shaderpack::tests -- --nocapture

Tree Result
Unmodified PR head 3 passed, 0 failed, 0 ignored; native exit 0
Unmodified main 3 passed, 0 failed, 0 ignored; native exit 0
PR patch applied to pinned main 3 passed, 0 failed, 0 ignored; native exit 0

Main baseline pin: 63bcca43c6a00a758510398fa43096ce7e4f7df0.

Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits.
This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed.

AI-assisted verification.

**@⁠oddmaniv** on GitHub · 2026-11-27 18:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/3546#issuecomment-7225425822) Independent verification of the PR author's shader-package parser tests at `26923a02d3bd981fa9c26d31ba596430fbb04732`. `cargo test --locked -p victory-game --lib shaderpack::tests -- --nocapture` | Tree | Result | | --- | --- | | Unmodified PR head | 3 passed, 0 failed, 0 ignored; native exit 0 | | Unmodified main | 3 passed, 0 failed, 0 ignored; native exit 0 | | PR patch applied to pinned main | 3 passed, 0 failed, 0 ignored; native exit 0 | Main baseline pin: `63bcca43c6a00a758510398fa43096ce7e4f7df0`. Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits. This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed. AI-assisted verification.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3546/head:github-bot/gh-3546'
git switch 'github-bot/gh-3546'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3546'
git switch 'github-bot/gh-3546'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3546'
git switch 'github-bot/gh-3546'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3546'
git switch 'main'
git merge --squash 'github-bot/gh-3546'
git switch 'main'
git merge --ff-only 'github-bot/gh-3546'
git switch 'main'
git merge 'github-bot/gh-3546'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3546
No description provided.