fix(cli): hash only the embedded DXBC container #21

Merged
yualk merged 1 commit from upstream-pr/21 into main 2026-11-27 08:25:18 +00:00
yualk commented 2026-11-27 08:17:56 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by yualk on 2026-11-27T08:17:56Z.


What and why

The embedded scanner validates the DXBC header, but passes the entire carrier tail to offline hashing. A shader requested by its runtime hash can therefore be skipped by translate --warm. Return the validated DXBC extent as a borrowed slice. Preserve the file offset, packed SGD5 behavior, runtime cache identity, and translator source.

Related prior work: DexNom/VIctory #116 handles the same raw issue and additionally covers packed padding. This PR is raw-scan only.

Tested on

Windows 11 Pro build 26200, Ryzen 7 9800X3D, Rust/MSVC 1.98.1. Host RTX 5070 Ti, driver 610.88; these checks do not use the GPU. Tested against c437b0594b plus this patch.

  • cargo +1.98.1 test --locked --offline --profile diag -p victory --features diagnostics --bin victory shader::tests::embedded_containers_keep_runtime_hashes -- --exact — 1 passed.
  • cargo +1.98.1 build --locked --offline --profile diag -p victory --features diagnostics — passed, with existing unrelated warnings.
  • victory shader-info --verbose solo.cdxil carrier.bin — exactly two sources, both 252d095627775c35; dangling magic ignored.

Synthetic input:

from pathlib import Path
from struct import pack

shader = b"DXBC" + bytes(16) + pack("<HHII", 1, 0, 32, 0)
Path("solo.cdxil").write_bytes(shader)
Path("carrier.bin").write_bytes(b"MZ" + shader + b"carrier suffix" + b"DXBC")

Not tested

No game, GPU pipeline warmup, startup timing, gameplay, or FPS claim. No game material is needed for the test.

AI use

omp with OpenAI GPT-6.2 Sol assisted with the patch, review, and local verification.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5523441694 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/21). Originally posted by [yualk](https://github.com/yualk) on 2026-11-27T08:17:56Z. --- ## What and why The embedded scanner validates the DXBC header, but passes the entire carrier tail to offline hashing. A shader requested by its runtime hash can therefore be skipped by `translate --warm`. Return the validated DXBC extent as a borrowed slice. Preserve the file offset, packed SGD5 behavior, runtime cache identity, and translator source. Related prior work: [DexNom/VIctory #116](https://github.com/DexNom/VIctory/pull/116) handles the same raw issue and additionally covers packed padding. This PR is raw-scan only. ## Tested on Windows 11 Pro build 26200, Ryzen 7 9800X3D, Rust/MSVC 1.98.1. Host RTX 5070 Ti, driver 610.88; these checks do not use the GPU. Tested against `c437b0594b` plus this patch. - `cargo +1.98.1 test --locked --offline --profile diag -p victory --features diagnostics --bin victory shader::tests::embedded_containers_keep_runtime_hashes -- --exact` — 1 passed. - `cargo +1.98.1 build --locked --offline --profile diag -p victory --features diagnostics` — passed, with existing unrelated warnings. - `victory shader-info --verbose solo.cdxil carrier.bin` — exactly two sources, both `252d095627775c35`; dangling magic ignored. Synthetic input: ```python from pathlib import Path from struct import pack shader = b"DXBC" + bytes(16) + pack("<HHII", 1, 0, 32, 0) Path("solo.cdxil").write_bytes(shader) Path("carrier.bin").write_bytes(b"MZ" + shader + b"carrier suffix" + b"DXBC") ``` ## Not tested No game, GPU pipeline warmup, startup timing, gameplay, or FPS claim. No game material is needed for the test. ## AI use omp with OpenAI GPT-6.2 Sol assisted with the patch, review, and local verification.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!21
No description provided.