CLI: include runtime shader hashes in the translation listing #378

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

@⁠Mesrine67 on GitHub · 2026-11-24 02:45 UTC · original
Mesrine67:feat/translate-list-hash → main · +17 −6 · 2 files · 1 commits · open

Summary

translate --list now prints the 16-character BLAKE3 hash VIctory uses for runtime pipeline diagnostics. List mode also processes containers with duplicate DXIL, since distinct containers can have different runtime hashes even when they translate to identical DXIL. The regular aggregate scan remains deduplicated and does not compute this extra hash.

- shaders.rpf@0x... ShaderName <failure>
+ shaders.rpf@0x... ShaderName hash=0123456789abcdef <failure>

Related to #293.

Evidence

  • Before: local --list failure rows had archive locations and offsets but no runtime hash, so the highest-loss hashes in #293 could not be joined to translation failures.
  • After: the local v1.0.2.1 archive maps these issue hashes to shader failures:
    • 910b4be059bfb28f -> MSNC_VS_LinearDepthSkin_1b4b70ba_Wrapped: descriptor neither loaded nor built.
    • 321d411b20a35ef9 -> MSNC_VS_LinearDepthSkin_f1f2249c_Wrapped: descriptor neither loaded nor built.
    • adc5c689b0552cc2 -> MS_VS_PropFoliageDeferred_7cf79608_Wrapped: descriptor neither loaded nor built.
    • e30970f1727063fd -> CS_ComputeImposterTransform_15082ab2_Wrapped: structured buffer of unknown stride.
    • caf96a3229145fa6 -> CS_CollisionRaytraced_2776e795_Wrapped: address not from a root parameter.
  • The local scan used clean upstream d2a4bae, without the PR stack listed in #293. Its translation failure counts are not in-game draw-loss measurements.
  • cargo test -p victory --locked — 1 passed.
  • cargo build -p victory --locked — passed.
  • rustfmt --check --edition 2024 apps/victory/src/main.rs apps/victory/src/translate.rs — passed.

Merge Danger

Door: Two-way

Blast Radius: CLI

Hashing and processing duplicate DXIL containers happens only in --list; the regular aggregate scan keeps its existing deduplication path.

**@⁠Mesrine67** on GitHub · 2026-11-24 02:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/378) `Mesrine67:feat/translate-list-hash` → `main` · +17 −6 · 2 files · 1 commits · open ## Summary `translate --list` now prints the 16-character BLAKE3 hash VIctory uses for runtime pipeline diagnostics. List mode also processes containers with duplicate DXIL, since distinct containers can have different runtime hashes even when they translate to identical DXIL. The regular aggregate scan remains deduplicated and does not compute this extra hash. ```diff - shaders.rpf@0x... ShaderName <failure> + shaders.rpf@0x... ShaderName hash=0123456789abcdef <failure> ``` Related to #293. ## Evidence - **Before:** local `--list` failure rows had archive locations and offsets but no runtime hash, so the highest-loss hashes in #293 could not be joined to translation failures. - **After:** the local v1.0.2.1 archive maps these issue hashes to shader failures: - `910b4be059bfb28f` -> `MSNC_VS_LinearDepthSkin_1b4b70ba_Wrapped`: descriptor neither loaded nor built. - `321d411b20a35ef9` -> `MSNC_VS_LinearDepthSkin_f1f2249c_Wrapped`: descriptor neither loaded nor built. - `adc5c689b0552cc2` -> `MS_VS_PropFoliageDeferred_7cf79608_Wrapped`: descriptor neither loaded nor built. - `e30970f1727063fd` -> `CS_ComputeImposterTransform_15082ab2_Wrapped`: structured buffer of unknown stride. - `caf96a3229145fa6` -> `CS_CollisionRaytraced_2776e795_Wrapped`: address not from a root parameter. - The local scan used clean upstream `d2a4bae`, without the PR stack listed in #293. Its translation failure counts are not in-game draw-loss measurements. - `cargo test -p victory --locked` — 1 passed. - `cargo build -p victory --locked` — passed. - `rustfmt --check --edition 2024 apps/victory/src/main.rs apps/victory/src/translate.rs` — passed. ## Merge Danger **Door:** Two-way **Blast Radius:** CLI Hashing and processing duplicate DXIL containers happens only in `--list`; the regular aggregate scan keeps its existing deduplication path.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:01:43 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 04:14 UTC · original

Thanks @⁠TurGangS for this listing improvement. I tested head 2392dfd79a190bd3a8a0ab568b28d306cda37980 with:

cargo test --locked -p victory

Result: 1 passed, 0 failed. The command compiled the modified CLI package and ran its existing run::tests::loader_lock_is_reentrant_and_exclusive test. There is no test in this package for the new --list runtime-hash or duplicate-container rows, so those output changes remain unexercised by this run; I did not launch the application.

**@⁠jeremygold02** on GitHub · 2026-11-24 04:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/378#issuecomment-7121835643) Thanks @⁠TurGangS for this listing improvement. I tested head `2392dfd79a190bd3a8a0ab568b28d306cda37980` with: ``` cargo test --locked -p victory ``` Result: 1 passed, 0 failed. The command compiled the modified CLI package and ran its existing `run::tests::loader_lock_is_reentrant_and_exclusive` test. There is no test in this package for the new `--list` runtime-hash or duplicate-container rows, so those output changes remain unexercised by this run; I did not launch the application.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 18:59 UTC · original

Checked the printed hashes against the runtime side: they match, and there is one scope gap worth knowing.

I built head 2392dfd and its real base d2a4bae (131 commits behind main at ffe310e, which is why the two report different translator outcomes) and ran the same command over a local copy of the v1.0.2.1 shader archive — Windows 11 26100, RTX 4090, driver 621.24, validator dxil.dll from SDK 10.0.26100.0, --jobs 10:

victory translate shaders.rpf --validate --list --jobs 10

What the change actually does, measured against its own base:

d2a4bae (base) 2392dfd (this PR)
container header 26503 (614 duplicates skipped) 26503 (0 duplicates skipped)
per-program rows 25,889 26,503, every row carrying hash=
distinct hash= values in those rows — 25,889
programs translated 26084 of 26084 26698 of 26698
refused programs summed over the reason table 3,918 3,933

The hash is the same value the runtime logs. I had derived that mapping independently of this PR: crates/victory-gpu/src/pipeline.rs interns containers by blake3::hash(bytes) and logs full.to_hex()[..16], so a ~60-line program of mine built on victory_game::sgd5 that hashes each record's unpacked bytes — plus every DXBC container stored uncompressed, whose length is the field at offset 0x18 — gives 26,503 records and 25,889 distinct byte strings for this file. That 614 is exactly the number the header reports, so the dedup and my count are the same measurement from two sides. Fed into the title's own first bind lines from two 900-second runs I made on ffe310e with the same GPU and driver: all 25 distinct containers those runs bound correspond to a container in the package byte for byte, and the size= in those lines equals the container length in all 25 cases. With this PR's listing, 23 of those 25 appear with identical hex digits and are marked validated — VS_Blit_6e5520d1_Wrapped @0x10295f96 hash=58d926085fca4999, VText_a4ab6e63_Wrapped @0x102f2098 hash=d5b1bcfe40fd84b2, postfx_lut:CS_LUT3DBakeColorGradingAdjustments_39a5dbbe hash=052a2316a03b9ba1, and 20 more. So the value this prints is usable to join a runtime log to the census, which is what #293 wants.

One gap in scope. The 2 that do not appear are not in the archive: they are stored uncompressed inside the title's own executable (@0x688cd3c, 992 B vertex and @0x688e86f, 964 B pixel → dfafaf385b2f94e8 and 06295fb1d1aefb78), and they are the first two first bind lines of both of my runs (frame 2, user_data=0 samplers=0) — the first pipelines any boot binds at all. apps/victory/src/shader.rs::sources() does find them when the executable is in scope, through its raw DXBC scan; a listing pointed only at the shader archives cannot see them. For "which shaders does the title actually use", that is a real blind spot rather than a defect of this PR.

Two things I would want before the listing is used as the base of the #293 ranking.

  1. --validate is part of the recipe, not an option: --list without it prints failure rows only, on the head (3,782 rows, none validated) and on main ffe310e (4,041 rows, none validated). The programs that work — which is most of what the ranking needs — get a hash= only in a validated run.
  2. --list and the aggregate mode now disagree for the same input and the same commit: 3,933 refused programs with --list against 3,918 without, and the header claims 0 duplicates skipped while the aggregate header claims 614. Anyone comparing a listing against the published table hits a 15-program difference that has nothing to do with the translator. Keeping the count in the header (614 duplicate containers included) or adding a line stating that list mode expands them would keep the two modes comparable. Related: joining by hash= will match several rows, because the archive genuinely contains repeats (504 of those 25,889 hashes appear in 2 or 3 records — MS_VS_TransformD_c5fd36bb_Wrapped in three), and the runtime shares one translation between them.

As @⁠jeremygold02 noted, no test exercises either new output. A case with two identical containers asserting the same hash= on both rows, and one asserting a known container's row carries the expected digest, would cover both changes at once.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 18:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/378#issuecomment-7141444241) **Checked the printed hashes against the runtime side: they match, and there is one scope gap worth knowing.** I built head `2392dfd` and its real base `d2a4bae` (131 commits behind `main` at `ffe310e`, which is why the two report different translator outcomes) and ran the same command over a local copy of the v1.0.2.1 shader archive — Windows 11 26100, RTX 4090, driver 621.24, validator `dxil.dll` from SDK 10.0.26100.0, `--jobs 10`: ``` victory translate shaders.rpf --validate --list --jobs 10 ``` What the change actually does, measured against its own base: | | `d2a4bae` (base) | `2392dfd` (this PR) | | --- | --- | --- | | container header | `26503 (614 duplicates skipped)` | `26503 (0 duplicates skipped)` | | per-program rows | 25,889 | 26,503, every row carrying `hash=` | | distinct `hash=` values in those rows | — | 25,889 | | programs translated | `26084 of 26084` | `26698 of 26698` | | refused programs summed over the reason table | 3,918 | 3,933 | **The hash is the same value the runtime logs.** I had derived that mapping independently of this PR: `crates/victory-gpu/src/pipeline.rs` interns containers by `blake3::hash(bytes)` and logs `full.to_hex()[..16]`, so a ~60-line program of mine built on `victory_game::sgd5` that hashes each record's unpacked bytes — plus every `DXBC` container stored uncompressed, whose length is the field at offset `0x18` — gives 26,503 records and 25,889 distinct byte strings for this file. That 614 is exactly the number the header reports, so the dedup and my count are the same measurement from two sides. Fed into the title's own `first bind` lines from two 900-second runs I made on `ffe310e` with the same GPU and driver: all 25 distinct containers those runs bound correspond to a container in the package byte for byte, and the `size=` in those lines equals the container length in all 25 cases. With this PR's listing, 23 of those 25 appear with identical hex digits and are marked `validated` — `VS_Blit_6e5520d1_Wrapped @0x10295f96 hash=58d926085fca4999`, `VText_a4ab6e63_Wrapped @0x102f2098 hash=d5b1bcfe40fd84b2`, `postfx_lut:CS_LUT3DBakeColorGradingAdjustments_39a5dbbe hash=052a2316a03b9ba1`, and 20 more. So the value this prints is usable to join a runtime log to the census, which is what #293 wants. **One gap in scope.** The 2 that do not appear are not in the archive: they are stored uncompressed inside the title's own executable (`@0x688cd3c`, 992 B vertex and `@0x688e86f`, 964 B pixel → `dfafaf385b2f94e8` and `06295fb1d1aefb78`), and they are the first two `first bind` lines of both of my runs (frame 2, `user_data=0 samplers=0`) — the first pipelines any boot binds at all. `apps/victory/src/shader.rs::sources()` does find them when the executable is in scope, through its raw `DXBC` scan; a listing pointed only at the shader archives cannot see them. For "which shaders does the title actually use", that is a real blind spot rather than a defect of this PR. **Two things I would want before the listing is used as the base of the #293 ranking.** 1. `--validate` is part of the recipe, not an option: `--list` without it prints failure rows only, on the head (3,782 rows, none `validated`) and on `main` `ffe310e` (4,041 rows, none `validated`). The programs that work — which is most of what the ranking needs — get a `hash=` only in a validated run. 2. `--list` and the aggregate mode now disagree for the same input and the same commit: 3,933 refused programs with `--list` against 3,918 without, and the header claims `0 duplicates skipped` while the aggregate header claims `614`. Anyone comparing a listing against the published table hits a 15-program difference that has nothing to do with the translator. Keeping the count in the header (`614 duplicate containers included`) or adding a line stating that list mode expands them would keep the two modes comparable. Related: joining by `hash=` will match several rows, because the archive genuinely contains repeats (504 of those 25,889 hashes appear in 2 or 3 records — `MS_VS_TransformD_c5fd36bb_Wrapped` in three), and the runtime shares one translation between them. As @⁠jeremygold02 noted, no test exercises either new output. A case with two identical containers asserting the same `hash=` on both rows, and one asserting a known container's row carries the expected digest, would cover both changes at once. Written with an AI assistant.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:28 UTC · original

Automated triage for the maintainers.

Needs work. Joining --list rows to the runtime hash is useful. Two things:

  1. Wrong bytes for raw containers. In translate() the hash is blake3::hash(&bytes), but for Source::Raw that slice is &data[offset..] to the end of the file (Source::bytes in apps/victory/src/shader.rs), while the runtime (Shader::new in victory-gpu/src/pipeline.rs) hashes only the container. Trim to the size field at 0x18 first, as the survey in shader.rs and the warm-up loop in translate.rs already do.
  2. --list changes the totals. Duplicates are no longer counted or skipped, so the header shows "0 duplicates skipped" and program/refusal counts are inflated. Keep the counts the same and still print the extra rows.

A test with two identical containers checking the same hash= would help. Please also rebase: translate() on main now accepts an ACCC part.

CI: no check runs on the head commit.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/378#issuecomment-7148543080) <!-- victory-triage v1 head=2392dfd79a190bd3a8a0ab568b28d306cda37980 verdict=needs-work at=2026-11-25T00:22:20Z --> Automated triage for the maintainers. **Needs work.** Joining `--list` rows to the runtime hash is useful. Two things: 1. **Wrong bytes for raw containers.** In `translate()` the hash is `blake3::hash(&bytes)`, but for `Source::Raw` that slice is `&data[offset..]` to the end of the file (`Source::bytes` in `apps/victory/src/shader.rs`), while the runtime (`Shader::new` in `victory-gpu/src/pipeline.rs`) hashes only the container. Trim to the size field at 0x18 first, as the survey in `shader.rs` and the warm-up loop in `translate.rs` already do. 2. **`--list` changes the totals.** Duplicates are no longer counted or skipped, so the header shows "0 duplicates skipped" and program/refusal counts are inflated. Keep the counts the same and still print the extra rows. A test with two identical containers checking the same `hash=` would help. Please also rebase: `translate()` on main now accepts an ACCC part. CI: no check runs on the head commit. --- _Generated by [Claude Code](https://claude.ai/code)_
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/378/head:github-bot/gh-378'
git switch 'github-bot/gh-378'

Merge

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