CLI: count all SGD5 hashes and stripped-bitcode XDAT/xbop markers in shader-info #3020

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

@⁠fuzeofficlal on GitHub · 2026-11-26 03:32 UTC · original
fuzeofficlal:fix/cli-shader-info-coverage-xdat → main · +152 −37 · 1 files · 1 commits · open

Summary

  • Populate Totals::engine (HashSet<u64>) directly from parsed sgd5::databases(&data) entries in apps/victory/src/shader.rs::record_database_hashes, rather than only inside the branch where native program extraction succeeds. Fixes victory shader-info undercounting graphics/compute shader-pack database hash coverage for valid SGD5 entries that hold standard DXIL without native programs.
  • Detect XDAT prefix (+0x18, matching victory-shader/src/native.rs::XDAT_OFFSET) and xbop trailer bytes directly from the DXIL part header in Totals::describe_dxil / dxil_trailer independently of DxilProgram::parse (which requires LLVM bitcode magic), so stripped-bitcode containers still report accurate XDAT prefix and xbop trailer totals and verbose flags.
  • Add 2 synthetic unit tests (counts_standard_dxil_database_hash and counts_xbox_extras_without_llvm_bitcode) covering both fixes.

Verification

  • rustfmt --edition 2024 --check apps/victory/src/shader.rs: ok.
  • cargo test --locked -p victory: 16 unit tests + 4 integration tests passed.
  • cargo clippy --locked -p victory --all-targets -- -D warnings (default and --all-features): 0 warnings.
  • cargo xtask policy: 191 files ok.
**@⁠fuzeofficlal** on GitHub · 2026-11-26 03:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/3020) `fuzeofficlal:fix/cli-shader-info-coverage-xdat` → `main` · +152 −37 · 1 files · 1 commits · open ## Summary - Populate `Totals::engine` (`HashSet<u64>`) directly from parsed `sgd5::databases(&data)` entries in `apps/victory/src/shader.rs::record_database_hashes`, rather than only inside the branch where native program extraction succeeds. Fixes `victory shader-info` undercounting graphics/compute shader-pack database hash coverage for valid SGD5 entries that hold standard DXIL without native programs. - Detect `XDAT` prefix (`+0x18`, matching `victory-shader/src/native.rs::XDAT_OFFSET`) and `xbop` trailer bytes directly from the `DXIL` part header in `Totals::describe_dxil` / `dxil_trailer` independently of `DxilProgram::parse` (which requires LLVM bitcode magic), so stripped-bitcode containers still report accurate `XDAT prefix` and `xbop trailer` totals and verbose flags. - Add 2 synthetic unit tests (`counts_standard_dxil_database_hash` and `counts_xbox_extras_without_llvm_bitcode`) covering both fixes. ## Verification - `rustfmt --edition 2024 --check apps/victory/src/shader.rs`: ok. - `cargo test --locked -p victory`: 16 unit tests + 4 integration tests passed. - `cargo clippy --locked -p victory --all-targets -- -D warnings` (default and `--all-features`): 0 warnings. - `cargo xtask policy`: 191 files ok.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:20:18 +00:00
github-bot force-pushed github-bot/gh-3020 from b59f893c93 to c3d3a03d6b 2026-11-26 06:31:55 +00:00 Compare
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 05:40 UTC · original

Independent Windows x64 CPU verification of b59f893c93db318ac33c2bf4627adb8cfbbcd5b0 against its exact parent 63bcca43c6a00a758510398fa43096ce7e4f7df0 (Rust 1.98.1, cargo build --locked -j 4 -p victory at both commits). All CLI inputs were synthetic. The runs used no GPU adapter.

victory shader-info check Exact parent PR head
Graphics pack entries matched by an SGD5 database hash for standard DXIL without native code 0/1 1/1
Compute pack entries matched by an SGD5 database hash for standard DXIL without native code 0/1 1/1
XDAT prefixes in three containers with zero parsable LLVM programs 0 3
xbop trailers in those same containers 0 2

The head's verbose flags showed xdat true in all three stripped cases and xbop true only for the two actual trailers. The third fixture put xbop inside the declared bitcode span. A separate control with three containers carrying LLVM bitcode magic gave identical counts at both commits (three bitcode programs, two XDAT prefixes, two xbop trailers).

At the head, cargo test --locked -j 4 -p victory passed 16 unit tests and 4 integration tests, including counts_standard_dxil_database_hash and counts_xbox_extras_without_llvm_bitcode. Clippy with --all-targets -- -D warnings passed with default and all features. The asset policy passed for 191 files. With rustfmt 1.9.0, rustfmt --edition 2024 --check apps/victory/src/shader.rs passed at the parent and exited 1 at the head, requesting a multiline words(...) call in the new test helper.

AI use: Claude Code (Claude Opus 5.5) created the fixtures and built and ran the exact-commit controls. Codex (gpt-6.2-sol) checked the diff, repeated the CLI comparisons with those builds and fixtures, ran the tests and tooling checks, and drafted this report.

**@⁠oni-swr** on GitHub · 2026-11-26 05:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/3020#issuecomment-7183702980) Independent Windows x64 CPU verification of `b59f893c93db318ac33c2bf4627adb8cfbbcd5b0` against its exact parent `63bcca43c6a00a758510398fa43096ce7e4f7df0` (Rust 1.98.1, `cargo build --locked -j 4 -p victory` at both commits). All CLI inputs were synthetic. The runs used no GPU adapter. | `victory shader-info` check | Exact parent | PR head | | --- | --- | --- | | Graphics pack entries matched by an SGD5 database hash for standard DXIL without native code | 0/1 | 1/1 | | Compute pack entries matched by an SGD5 database hash for standard DXIL without native code | 0/1 | 1/1 | | XDAT prefixes in three containers with zero parsable LLVM programs | 0 | 3 | | xbop trailers in those same containers | 0 | 2 | The head's verbose flags showed `xdat true` in all three stripped cases and `xbop true` only for the two actual trailers. The third fixture put `xbop` inside the declared bitcode span. A separate control with three containers carrying LLVM bitcode magic gave identical counts at both commits (three bitcode programs, two XDAT prefixes, two xbop trailers). At the head, `cargo test --locked -j 4 -p victory` passed 16 unit tests and 4 integration tests, including `counts_standard_dxil_database_hash` and `counts_xbox_extras_without_llvm_bitcode`. Clippy with `--all-targets -- -D warnings` passed with default and all features. The asset policy passed for 191 files. With rustfmt 1.9.0, `rustfmt --edition 2024 --check apps/victory/src/shader.rs` passed at the parent and exited 1 at the head, requesting a multiline `words(...)` call in the new test helper. AI use: Claude Code (Claude Opus 5.5) created the fixtures and built and ran the exact-commit controls. Codex (gpt-6.2-sol) checked the diff, repeated the CLI comparisons with those builds and fixtures, ran the tests and tooling checks, and drafted this report.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 06:12 UTC · original

Thanks @⁠oni-swr for checking! Fixed the rustfmt line-wrap nit in apps/victory/src/shader.rs and force-pushed (rustfmt --edition 2024 --check, cargo test -p victory --locked, and cargo clippy -p victory --locked --all-targets -- -D warnings all pass).

**@⁠fuzeofficlal** on GitHub · 2026-11-26 06:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/3020#issuecomment-7184200261) Thanks @⁠oni-swr for checking! Fixed the `rustfmt` line-wrap nit in `apps/victory/src/shader.rs` and force-pushed (`rustfmt --edition 2024 --check`, `cargo test -p victory --locked`, and `cargo clippy -p victory --locked --all-targets -- -D warnings` all pass).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 06:17 UTC · original

Automated triage for the maintainers.

Two counting fixes to victory shader-info in apps/victory/src/shader.rs:

  • Totals::engine is now every hash from the parsed SGD5 databases (record_database_hashes). On main a hash was recorded only inside the branch where native programs were extracted, so list_pack's "shader hash in a database" lines undercounted standard-DXIL entries.
  • describe_dxil / dxil_trailer read the XDAT prefix at 0x18 and the xbop trailer from the DXIL part header directly, using the same offsets as DxilProgram::parse and native.rs's XDAT_OFFSET. Stripped-bitcode containers are therefore still counted.

This is diagnostics only, with bounds-checked header reads and synthetic tests. CI check: passing on this head. The independent verification in the thread was on the earlier head b59f893, before the rustfmt-only force-push.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 06:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/3020#issuecomment-7184279043) <!-- victory-triage v1 head=c3d3a03d6b25b0fb3c6729cc0fb19e11fa2dab53 verdict=merge-candidate at=2026-11-26T06:17:06Z --> Automated triage for the maintainers. Two counting fixes to `victory shader-info` in `apps/victory/src/shader.rs`: - `Totals::engine` is now every hash from the parsed SGD5 databases (`record_database_hashes`). On `main` a hash was recorded only inside the branch where native programs were extracted, so `list_pack`'s "shader hash in a database" lines undercounted standard-DXIL entries. - `describe_dxil` / `dxil_trailer` read the `XDAT` prefix at `0x18` and the `xbop` trailer from the DXIL part header directly, using the same offsets as `DxilProgram::parse` and `native.rs`'s `XDAT_OFFSET`. Stripped-bitcode containers are therefore still counted. This is diagnostics only, with bounds-checked header reads and synthetic tests. CI `check`: passing on this head. The independent verification in the thread was on the earlier head `b59f893`, before the rustfmt-only force-push. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-26 04:39 UTC · original · approved these changes

LGTM — dxil_trailer parses the DXILProgramHeader correctly (magic@8, bitcode_offset@0x10, bitcode_size@0x14); trailer scan finds xbop after stripped bitcode; HashSet dedup of database hashes is the right container.

**@⁠kotekompotek** on GitHub · 2026-11-26 04:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/3020#pullrequestreview-6068630886) · **approved these changes** LGTM — dxil_trailer parses the DXILProgramHeader correctly (magic@8, bitcode_offset@0x10, bitcode_size@0x14); trailer scan finds xbop after stripped bitcode; HashSet dedup of database hashes is the right container.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 09:10 UTC · original · approved these changes

Verified against origin/main (63bcca4):

  • cargo test -p victory -- --test-threads=1: 16 lib + 4 integration tests passed (including shader::tests::counts_standard_dxil_database_hash and shader::tests::counts_xbox_extras_without_llvm_bitcode).
  • cargo clippy -p victory --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly counts all SGD5 hashes and stripped-bitcode XDAT/xbop markers in shader-info.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 09:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/3020#pullrequestreview-6071263630) · **approved these changes** Verified against `origin/main` (`63bcca4`): - `cargo test -p victory -- --test-threads=1`: 16 lib + 4 integration tests passed (including `shader::tests::counts_standard_dxil_database_hash` and `shader::tests::counts_xbox_extras_without_llvm_bitcode`). - `cargo clippy -p victory --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly counts all SGD5 hashes and stripped-bitcode XDAT/xbop markers in `shader-info`. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 18:44 UTC · original

NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head c3d3a03 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 868 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: counts_standard_dxil_database_hash, counts_xbox_extras_without_llvm_bitcode.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-26 18:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/3020#issuecomment-7200801097) NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head `c3d3a03` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **868 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `counts_standard_dxil_database_hash`, `counts_xbox_extras_without_llvm_bitcode`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
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/3020/head:github-bot/gh-3020'
git switch 'github-bot/gh-3020'

Merge

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