Shader tests: translate the BC6H index width lookup #2687

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

@⁠Dathinel on GitHub · 2026-11-25 18:14 UTC · original
Dathinel:shader-tests/victory-bc6-index-width → main · +28 −0 · 1 files · 1 commits · open

Adds a synthetic console shader for bc6_index_bits, the BCPack helper that gives BC6H modes 1–10 three index bits, modes 11–14 four bits, and all other mode bytes zero. The test runs the hand-written instruction sequence through the emitter for all 256 byte values. I separately compiled the private Rust helper from base 13f91ca and verified the expected values for its entire input domain.

On Windows, cargo test --locked -p victory-shader --features host --lib bcpack_bc6_index_width_for_every_mode -- --nocapture passed on an RTX 3050 Laptop and WARP in 13.10 s. Extending the first interval by one returned 7 instead of 4 for mode 11. Extending the second returned 4 instead of 0 for mode 15. Both controls failed on hardware.

Targeted Clippy and the staged asset check passed. The full workspace suite was not run. AI-assisted: Claude Code wrote the original synthetic shader and reviewed the port. Codex ported it and ran the checks.

**@⁠Dathinel** on GitHub · 2026-11-25 18:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/2687) `Dathinel:shader-tests/victory-bc6-index-width` → `main` · +28 −0 · 1 files · 1 commits · open Adds a synthetic console shader for `bc6_index_bits`, the BCPack helper that gives BC6H modes 1–10 three index bits, modes 11–14 four bits, and all other mode bytes zero. The test runs the hand-written instruction sequence through the emitter for all 256 byte values. I separately compiled the private Rust helper from base `13f91ca` and verified the expected values for its entire input domain. On Windows, `cargo test --locked -p victory-shader --features host --lib bcpack_bc6_index_width_for_every_mode -- --nocapture` passed on an RTX 3050 Laptop and WARP in 13.10 s. Extending the first interval by one returned 7 instead of 4 for mode 11. Extending the second returned 4 instead of 0 for mode 15. Both controls failed on hardware. Targeted Clippy and the staged asset check passed. The full workspace suite was not run. AI-assisted: Claude Code wrote the original synthetic shader and reviewed the port. Codex ported it and ran the checks.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:12:03 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 18:38 UTC · original

Correct - the two range tests (mode-1 < 10 unsigned for 1..=10, mode-11 < 4 for 11..=14) can't both fire and exclude 0 via wraparound, and all 256 mode bytes are checked against the private helper's whole domain.

**@⁠kotekompotek** on GitHub · 2026-11-25 18:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2687#issuecomment-7171181201) Correct - the two range tests (mode-1 < 10 unsigned for 1..=10, mode-11 < 4 for 11..=14) can't both fire and exclude 0 via wraparound, and all 256 mode bytes are checked against the private helper's whole domain.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 18:56 UTC · original

Independent WARP/CPU verification (claim: Marvisak/VIctory#1633)

  • PR head: 1b3e0ec2acbcc03b20872b987be6d72234b77626 / origin/main: 13f91caee25f2fdf2c062be5f7a27f058e51cbca
  • State: OPEN, non-draft; git merge-tree --write-tree origin/main <head> merges cleanly; no prior oni-swr comment on this head.
  • Environment: Windows 11 Pro 10.0.26200, VICTORY_WARP=1 + VICTORY_D3D12_WARP=1 (WARP only, no physical GPU, no game files/dumps/retail hashes), dxil.dll 1.8.2502.11 (Windows SDK 10.0.26100.0, via VICTORY_DXIL), rustc 1.98.1 (48a229cea 2026-09-01), debug profile, --locked.

Commands / results (baseline = origin/main, same environment)

cargo test -p victory-shader --locked
cargo test -p victory-gpu --locked
cargo clippy -p victory-shader --locked --all-targets
  • victory-shader: 268 passed / 3 failed / 3 ignored (+1 vs baseline, same 3 baseline failures). New test emit::valu_tests::bcpack_bc6_index_width_for_every_mode ok.
  • victory-gpu: 195 / 0 / 1 (unchanged).
  • clippy: 0 warnings, 0 errors (baseline also 0).
  • victory-shader baseline: 267 passed / 3 failed / 3 ignored. The 3 failures also fail on origin/main under WARP (identical set, not caused by this PR): synthetic_tests::a_mask_joined_with_data_at_a_uniform_loop_is_its_number, gathers_at_a_level_match_the_hardware, permutes_read_the_lane_named_and_zero_from_lanes_left_out. Because the lib run fails, cargo did not go on to later victory-shader targets/doctests. victory-gpu baseline: 195 passed / 0 failed / 1 ignored.

Negative control: test-only PR (no production hunk); the baseline lacks the test (267 vs 268 passed), so it cannot pass there.

Code review: Test-only. Exhaustively checks all 256 mode bytes against the expected index width (1..=10 -> 3, 11..=14 -> 4, else 0) through the real VALU translation on the available backends. Encodings and the unsigned-range-compare idiom look right; no bugs found.

Not tested: physical GPU hardware (RX 7800 XT or any), retail game run, release build, other crates.

AI use: Claude Code (Claude Sonnet 5.5) ran the commands and reviewed the diff; the results above are from the actual runs.

**@⁠oni-swr** on GitHub · 2026-11-25 18:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/2687#issuecomment-7171617784) **Independent WARP/CPU verification** (claim: Marvisak/VIctory#1633) - PR head: `1b3e0ec2acbcc03b20872b987be6d72234b77626` / `origin/main`: `13f91caee25f2fdf2c062be5f7a27f058e51cbca` - State: OPEN, non-draft; `git merge-tree --write-tree origin/main <head>` merges cleanly; no prior `oni-swr` comment on this head. - Environment: Windows 11 Pro 10.0.26200, `VICTORY_WARP=1` + `VICTORY_D3D12_WARP=1` (WARP only, no physical GPU, no game files/dumps/retail hashes), `dxil.dll` 1.8.2502.11 (Windows SDK 10.0.26100.0, via `VICTORY_DXIL`), rustc 1.98.1 (48a229cea 2026-09-01), debug profile, `--locked`. **Commands / results** (baseline = `origin/main`, same environment) ``` cargo test -p victory-shader --locked cargo test -p victory-gpu --locked cargo clippy -p victory-shader --locked --all-targets ``` - victory-shader: 268 passed / 3 failed / 3 ignored (+1 vs baseline, same 3 baseline failures). New test `emit::valu_tests::bcpack_bc6_index_width_for_every_mode` ok. - victory-gpu: 195 / 0 / 1 (unchanged). - clippy: 0 warnings, 0 errors (baseline also 0). - victory-shader baseline: 267 passed / 3 failed / 3 ignored. The 3 failures also fail on `origin/main` under WARP (identical set, not caused by this PR): `synthetic_tests::a_mask_joined_with_data_at_a_uniform_loop_is_its_number`, `gathers_at_a_level_match_the_hardware`, `permutes_read_the_lane_named_and_zero_from_lanes_left_out`. Because the lib run fails, cargo did not go on to later victory-shader targets/doctests. victory-gpu baseline: 195 passed / 0 failed / 1 ignored. **Negative control:** test-only PR (no production hunk); the baseline lacks the test (267 vs 268 passed), so it cannot pass there. **Code review:** Test-only. Exhaustively checks all 256 mode bytes against the expected index width (1..=10 -> 3, 11..=14 -> 4, else 0) through the real VALU translation on the available backends. Encodings and the unsigned-range-compare idiom look right; no bugs found. **Not tested:** physical GPU hardware (RX 7800 XT or any), retail game run, release build, other crates. **AI use:** Claude Code (Claude Sonnet 5.5) ran the commands and reviewed the diff; the results above are from the actual runs.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 19:20 UTC · original

Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP + dxil.dll verification and review of 1b3e0ec2 (on 13f91ca):

Verification (rustc 1.98.1 MSVC, Windows SDK 10.0.26100.0 dxil.dll)

  • cargo xtask policy: 184 files ok.
  • cargo clippy --locked -p victory-shader --all-targets -- -D warnings: 0 warnings.
  • cargo test --locked -p victory-shader --features host --lib bcpack_bc6_index_width_for_every_mode -- --nocapture: 1 passed, 0 failed (dxil.dll validation + RTX 5090 hardware + WARP all executed cleanly).

Review Notes

  • Matches victory-formats/src/bcpack.rs::bc6_index_bits exhaustively across all 256 byte values (0..=255) with exact assert_eq! assertions.
  • Clean zero-conflict 3-way git merge-tree across #2676, #2681, #2685, #2687, and #2700.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 19:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/2687#issuecomment-7172157955) Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP + `dxil.dll` verification and review of `1b3e0ec2` (on `13f91ca`): ### Verification (`rustc 1.98.1` MSVC, Windows SDK `10.0.26100.0` `dxil.dll`) - `cargo xtask policy`: **184 files ok**. - `cargo clippy --locked -p victory-shader --all-targets -- -D warnings`: **0 warnings**. - `cargo test --locked -p victory-shader --features host --lib bcpack_bc6_index_width_for_every_mode -- --nocapture`: **1 passed, 0 failed** (`dxil.dll` validation + RTX 5090 hardware + WARP all executed cleanly). ### Review Notes - Matches `victory-formats/src/bcpack.rs::bc6_index_bits` exhaustively across all 256 byte values (`0..=255`) with exact `assert_eq!` assertions. - Clean zero-conflict 3-way `git merge-tree` across #2676, #2681, #2685, #2687, and #2700.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:18 UTC · original

Automated triage for the maintainers.

Needs work. The test is correct (all 256 mode bytes against an independent match) and CI passes, but it is not clear what it adds:

  • It does not test bc6_index_bits in crates/victory-formats/src/bcpack.rs. That helper runs on the CPU and is never translated. The test hand-writes a seven-instruction GFX10 sequence and checks it against its own expected table, so "translate the BC6H index width lookup" describes something the test does not do.
  • The instructions it uses (v_add_nc_u32 with an inline -1, v_sub_nc_u32, v_cmp_gt_u32, v_cndmask_b32, v_or_b32) are already probed opcode by opcode in crates/victory-shader/src/emit/semantics_tests.rs.

What would change the verdict: name the translator path this sequence covers that the existing probes miss, and word the test around that path. See also #2685 and #2700 (same pattern); one PR covering the untested paths would be easier to review.

CI: check passing on this head.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/2687#issuecomment-7176199643) <!-- victory-triage v1 head=1b3e0ec2acbcc03b20872b987be6d72234b77626 verdict=needs-work at=2026-11-25T22:18:40Z --> Automated triage for the maintainers. **Needs work.** The test is correct (all 256 mode bytes against an independent `match`) and CI passes, but it is not clear what it adds: - It does not test `bc6_index_bits` in `crates/victory-formats/src/bcpack.rs`. That helper runs on the CPU and is never translated. The test hand-writes a seven-instruction GFX10 sequence and checks it against its own expected table, so "translate the BC6H index width lookup" describes something the test does not do. - The instructions it uses (`v_add_nc_u32` with an inline -1, `v_sub_nc_u32`, `v_cmp_gt_u32`, `v_cndmask_b32`, `v_or_b32`) are already probed opcode by opcode in `crates/victory-shader/src/emit/semantics_tests.rs`. What would change the verdict: name the translator path this sequence covers that the existing probes miss, and word the test around that path. See also #2685 and #2700 (same pattern); one PR covering the untested paths would be easier to review. CI: `check` passing on this head. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-26 13:26 UTC · original

Independent local verification of head 1b3e0ec on Windows 11, Rust 1.100.0/MSVC:

  • cargo test --locked -p victory-shader --lib -- emit::valu_tests::bcpack_bc6_index_width_for_every_mode --exact — 1 passed, 0 failed (273 filtered).
  • git diff --check 13f91ca HEAD — clean (diff vs origin/main trips an unrelated blank line at EOF in xma/tables.rs from newer main, not from this PR).
  • The new test name is absent from the merge base.

Used a worktree-local CARGO_TARGET_DIR. CPU-only synthetic instruction words; no game assets, extracted shaders or DRM material used. AI-assisted (Hy4 flash). GPU/driver: N/A for this CPU test.

**@⁠cloph-dsp** on GitHub · 2026-11-26 13:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/2687#issuecomment-7193355202) Independent local verification of head `1b3e0ec` on Windows 11, Rust 1.100.0/MSVC: - `cargo test --locked -p victory-shader --lib -- emit::valu_tests::bcpack_bc6_index_width_for_every_mode --exact` — 1 passed, 0 failed (273 filtered). - `git diff --check 13f91ca HEAD` — clean (diff vs `origin/main` trips an unrelated blank line at EOF in `xma/tables.rs` from newer main, not from this PR). - The new test name is absent from the merge base. Used a worktree-local `CARGO_TARGET_DIR`. CPU-only synthetic instruction words; no game assets, extracted shaders or DRM material used. AI-assisted (Hy4 flash). GPU/driver: N/A for this CPU test.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/2687/head:github-bot/gh-2687'
git switch 'github-bot/gh-2687'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2687'
git switch 'github-bot/gh-2687'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2687'
git switch 'github-bot/gh-2687'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2687'
git switch 'main'
git merge --squash 'github-bot/gh-2687'
git switch 'main'
git merge --ff-only 'github-bot/gh-2687'
git switch 'main'
git merge 'github-bot/gh-2687'
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!2687
No description provided.