CLI: discover compressed shader packs in archives without SGD5 or header magic #3004

Closed
github-bot wants to merge 1 commit from github-bot/gh-3004 into main AGit
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 03:09 UTC · original
fuzeofficlal:fix/cli-prebuild-compressed-pack → main · +242 −18 · 1 files · 1 commits · closed without merging

Summary

  • Decouple shader-pack discovery from shader-container indexing in apps/victory/src/prebuild.rs via collect_inputs and find_pack.
  • Keep the existing fast paths first (standalone PS\0\x09 files and SGD5 shader files), and fall back to calling shaderpack::find on remaining DXBC-only shader files and non-shader archive files within MAX_FILE (releasing non-shader file bytes during collection and keeping them out of shader_files).
  • Fixes victory translate --cache --pipelines skipping valid archives whose shader pack lives inside 16-byte-aligned zlib streams without a leading PS\0\x09 header or SGD5 marker.
  • Add 3 synthetic unit tests covering compressed pack-only archives, DXBC-plus-compressed-pack archives without SGD5, fast-path precedence/short-circuiting, and clean None handling without polluting shader_files.

Verification

  • rustfmt --edition 2024 --check apps/victory/src/prebuild.rs: ok.
  • cargo test -p victory --locked: 17 unit tests + 4 integration tests passed.
  • cargo clippy -p victory --locked --all-targets -- -D warnings (default and --all-features): 0 warnings.
  • cargo xtask policy: 191 files ok.
**@⁠fuzeofficlal** on GitHub · 2026-11-26 03:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/3004) `fuzeofficlal:fix/cli-prebuild-compressed-pack` → `main` · +242 −18 · 1 files · 1 commits · closed without merging ## Summary - Decouple shader-pack discovery from shader-container indexing in `apps/victory/src/prebuild.rs` via `collect_inputs` and `find_pack`. - Keep the existing fast paths first (standalone `PS\0\x09` files and `SGD5` shader files), and fall back to calling `shaderpack::find` on remaining `DXBC`-only shader files and non-shader archive files within `MAX_FILE` (releasing non-shader file bytes during collection and keeping them out of `shader_files`). - Fixes `victory translate --cache --pipelines` skipping valid archives whose shader pack lives inside 16-byte-aligned zlib streams without a leading `PS\0\x09` header or `SGD5` marker. - Add 3 synthetic unit tests covering compressed pack-only archives, `DXBC`-plus-compressed-pack archives without `SGD5`, fast-path precedence/short-circuiting, and clean `None` handling without polluting `shader_files`. ## Verification - `rustfmt --edition 2024 --check apps/victory/src/prebuild.rs`: ok. - `cargo test -p victory --locked`: 17 unit tests + 4 integration tests passed. - `cargo clippy -p victory --locked --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:19:53 +00:00
github-bot 2026-11-26 06:31:27 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 04:35 UTC · original

Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head 025b12d (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: 869 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: finds_compressed_pack_only_archive_without_polluting_shader_files, finds_compressed_pack_in_dxbc_archive_without_sgd5_magic, prefers_direct_magic_and_sgd5_fast_paths_and_returns_none_when_absent.
  • --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 04:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/3004#issuecomment-7182729911) Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `025b12d` (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`: **869 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `finds_compressed_pack_only_archive_without_polluting_shader_files`, `finds_compressed_pack_in_dxbc_archive_without_sgd5_magic`, `prefers_direct_magic_and_sgd5_fast_paths_and_returns_none_when_absent`. - `--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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 05:45 UTC · original

Automated triage for the maintainers.

Verdict: needs work. The refactor in apps/victory/src/prebuild.rs (collect_inputs, find_pack) looks right as written. shaderpack::find (victory-game/src/shaderpack.rs) already inflates a pack stored as 16-byte-aligned zlib streams, so this PR only widens which files run hands to it: DXBC-only shader files, and then any other file under MAX_FILE that is re-read and scanned.

What's missing is evidence that this case exists. main looks for the pack in files that start with PS\0\x09 or are SGD5, because, as the removed comment says, it ships beside the shader databases. The PR doesn't show a real install where the pack sits in a file without either marker. The tests build synthetic archives (RPF_NO_MAGIC_HDR plus a stored zlib stream) and only show that the new search finds what they plant. If no real layout needs it, the fallback adds a second read and a zlib scan of every unrelated file whenever the pack is missing, which is the case where run should just print "no shader pack" and stop.

To change the verdict, describe a real case where victory translate --cache --pipelines reported no shader pack on a valid install (file layout only, no game data) and this PR found it.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 05:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/3004#issuecomment-7183779737) <!-- victory-triage v1 head=025b12db97092fdb8d75147cd6afd52054220872 verdict=needs-work at=2026-11-26T05:45:23Z --> Automated triage for the maintainers. **Verdict: needs work.** The refactor in `apps/victory/src/prebuild.rs` (`collect_inputs`, `find_pack`) looks right as written. `shaderpack::find` (`victory-game/src/shaderpack.rs`) already inflates a pack stored as 16-byte-aligned zlib streams, so this PR only widens which files `run` hands to it: DXBC-only shader files, and then any other file under `MAX_FILE` that is re-read and scanned. What's missing is evidence that this case exists. `main` looks for the pack in files that start with `PS\0\x09` or are SGD5, because, as the removed comment says, it ships beside the shader databases. The PR doesn't show a real install where the pack sits in a file without either marker. The tests build synthetic archives (`RPF_NO_MAGIC_HDR` plus a stored zlib stream) and only show that the new search finds what they plant. If no real layout needs it, the fallback adds a second read and a zlib scan of every unrelated file whenever the pack is missing, which is the case where `run` should just print "no shader pack" and stop. To change the verdict, describe a real case where `victory translate --cache --pipelines` reported no shader pack on a valid install (file layout only, no game data) and this PR found it. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

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

Fair point from triage — I do not have a real install layout where the shader pack lives outside a PS\0\x09 file or an SGD5 archive, and scanning unrelated files on a missing-pack run adds unnecessary I/O. Closing to keep the queue clean; happy to revisit if a real install layout needs it.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 06:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/3004#issuecomment-7184141994) Fair point from triage — I do not have a real install layout where the shader pack lives outside a `PS\0\x09` file or an `SGD5` archive, and scanning unrelated files on a missing-pack run adds unnecessary I/O. Closing to keep the queue clean; happy to revisit if a real install layout needs it.

Pull request closed

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!3004
No description provided.