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

Manually merged
github merged 1 commit from github-bot/gh-21 into main 2026-11-27 08:27:42 +00:00 AGit
Owner

@⁠yualk on GitHub · 2026-11-27 08:17 UTC · original
yualk:fix/embedded-dxbc-extent → main · +28 −4 · 1 files · 1 commits · merged 2026-11-27 08:25 UTC

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.

**@⁠yualk** on GitHub · 2026-11-27 08:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/21) `yualk:fix/embedded-dxbc-extent` → `main` · +28 −4 · 1 files · 1 commits · merged 2026-11-27 08:25 UTC ## 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.
Validate and use the declared DXBC byte extent when scanning an embedded shader. Keep the borrowed slice and offset, and leave packed inputs unchanged.

Tested on Windows with the focused embedded-container regression and a synthetic CLI run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 08:21:37 +00:00
github manually merged commit 18a8dc2640 into main 2026-11-27 08:27:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.