CLI: reject VS+GS graphics pipelines in prebuild #2592

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

@⁠fuzeofficlal on GitHub · 2026-11-25 16:22 UTC · original
fuzeofficlal:fix/cli-prebuild-reject-vs-plus-gs → main · +224 −53 · 1 files · 1 commits · open

Summary

Fixes apps/victory/src/prebuild.rs silently dropping the geometry shader stage when a shaderpack graphics record carries both VS (stages[1]) and GS (stages[2]):

  • Previously, prepare only checked g.stages[3..] (ES/HS/LS/fetch) and then used vs.or(gs). When both vs and gs were present, vs.or(gs) picked vs and dropped gs, passing a bogus VS+PS stream without a geometry shader to Prebuild::graphics and persisting an unreachable PSO under the wrong key (whereas runtime HostPipeline::new rejects geometry stages).
  • Extracts prepare_graphics, explicitly rejecting vs.is_some() && gs.is_some() alongside g.stages[3..] as "stages other than vertex, mesh and pixel", and uses vs.xor(gs) for the single first stage.
  • Extracts shaders_of_graphics / format_stages so diagnostic VICTORY_PREBUILD_KEYS output lists all present stages (preserving the existing [vertex ..., pixel ...] and [mesh ..., pixel ...] formatting while no longer hiding GS behind VS or labeling standalone HwStage::Gs as mesh).

Verification

  • Added synthetic unit test prebuild::tests::prepare_rejects_vs_plus_gs_while_allowing_vs_and_ms_pipelines (apps/victory/src/prebuild.rs) covering VS+PS, MS+PS, VS+GS+PS, and unresolved VS+GS records.
  • cargo test -p victory -- --test-threads=1 (11 unit + 2 integration passed)
  • cargo clippy -p victory --all-targets -- -D warnings (default and --features diagnostics)
  • cargo xtask policy
**@⁠fuzeofficlal** on GitHub · 2026-11-25 16:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2592) `fuzeofficlal:fix/cli-prebuild-reject-vs-plus-gs` → `main` · +224 −53 · 1 files · 1 commits · open ## Summary Fixes `apps/victory/src/prebuild.rs` silently dropping the geometry shader stage when a shaderpack graphics record carries both `VS` (`stages[1]`) and `GS` (`stages[2]`): - Previously, `prepare` only checked `g.stages[3..]` (`ES/HS/LS/fetch`) and then used `vs.or(gs)`. When both `vs` and `gs` were present, `vs.or(gs)` picked `vs` and dropped `gs`, passing a bogus VS+PS stream without a geometry shader to `Prebuild::graphics` and persisting an unreachable PSO under the wrong key (whereas runtime `HostPipeline::new` rejects geometry stages). - Extracts `prepare_graphics`, explicitly rejecting `vs.is_some() && gs.is_some()` alongside `g.stages[3..]` as `"stages other than vertex, mesh and pixel"`, and uses `vs.xor(gs)` for the single first stage. - Extracts `shaders_of_graphics` / `format_stages` so diagnostic `VICTORY_PREBUILD_KEYS` output lists all present stages (preserving the existing `[vertex ..., pixel ...]` and `[mesh ..., pixel ...]` formatting while no longer hiding `GS` behind `VS` or labeling standalone `HwStage::Gs` as `mesh`). ## Verification - Added synthetic unit test `prebuild::tests::prepare_rejects_vs_plus_gs_while_allowing_vs_and_ms_pipelines` (`apps/victory/src/prebuild.rs`) covering `VS+PS`, `MS+PS`, `VS+GS+PS`, and unresolved `VS+GS` records. - `cargo test -p victory -- --test-threads=1` (11 unit + 2 integration passed) - `cargo clippy -p victory --all-targets -- -D warnings` (default and `--features diagnostics`) - `cargo xtask policy`
Prebuild::prepare_graphics now rejects graphics pack records carrying both VS and GS stages instead of silently dropping GS via vs.or(gs) and writing a bogus VS+PS pipeline into the library.

Also keep all non-empty stages (including GS and ES/HS/LS/fetch) in shaders_of diagnostic output while preserving the existing VS+PS and MS+PS formatting, and add unit tests covering VS+PS, MS+PS, and VS+GS handling.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:09:54 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:21 UTC · original

Automated triage for the maintainers.

Merge candidate. In apps/victory/src/prebuild.rs, prepare checked only stages[3..] and then took vs.or(gs). A record with both a vertex and a geometry program was therefore prebuilt as VS+PS, with the geometry stage silently dropped, and stored under that record's key. The runtime's HostPipeline::new (victory-gpu/src/pipeline/host.rs) refuses any stage other than vertex, mesh, pixel and compute, so that prebuilt pipeline could never be used as stored. prepare_graphics now rejects VS+GS with the existing message and picks the first stage with xor. shaders_of_graphics lists every stage present for VICTORY_PREBUILD_KEYS, and the vertex/mesh + pixel output format is unchanged. The test builds synthetic records for VS+PS, MS+PS and VS+GS(+PS).

CI: check passing. Merges cleanly into current main. A recommendation to look at it, not an approval.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/2592#issuecomment-7176260917) <!-- victory-triage v1 head=dd2d861605f48a1933773e30019bc47bd3d330c4 verdict=merge-candidate at=2026-11-25T22:21:18Z --> Automated triage for the maintainers. **Merge candidate.** In `apps/victory/src/prebuild.rs`, `prepare` checked only `stages[3..]` and then took `vs.or(gs)`. A record with both a vertex and a geometry program was therefore prebuilt as VS+PS, with the geometry stage silently dropped, and stored under that record's key. The runtime's `HostPipeline::new` (`victory-gpu/src/pipeline/host.rs`) refuses any stage other than vertex, mesh, pixel and compute, so that prebuilt pipeline could never be used as stored. `prepare_graphics` now rejects VS+GS with the existing message and picks the first stage with `xor`. `shaders_of_graphics` lists every stage present for `VICTORY_PREBUILD_KEYS`, and the vertex/mesh + pixel output format is unchanged. The test builds synthetic records for VS+PS, MS+PS and VS+GS(+PS). CI: `check` passing. Merges cleanly into current `main`. A recommendation to look at it, not an approval. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 01:32 UTC · original

Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head dd2d861 (on its base da82e44).

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: 774 passed, 0 failed, 9 ignored.
  • The new tests ran and passed: prepare_rejects_vs_plus_gs_while_allowing_vs_and_ms_pipelines.
  • --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 01:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/2592#issuecomment-7179874304) Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `dd2d861` (on its base `da82e44`). **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`: **774 passed, 0 failed, 9 ignored**. - The new tests ran and passed: `prepare_rejects_vs_plus_gs_while_allowing_vs_and_ms_pipelines`. - `--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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 15:57 UTC · original

The #2787 prebuild optimization now composes with this stage check in 3e2bb33. Both paths reject VS+GS before looking up keys or containers, and the diagnostic record still lists geometry alongside vertex and pixel. The shared regression and all 19 CLI tests pass. The maintainers can choose the merge order. Full check in #2787.

Please retain the Git authors on pickup. If folding the integration or its test into another commit, use Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 15:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/2592#issuecomment-7196986260) The #2787 prebuild optimization now composes with this stage check in [`3e2bb33`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/3e2bb33f614cdd6b123e37aa117e1afa63c537d9). Both paths reject VS+GS before looking up keys or containers, and the diagnostic record still lists geometry alongside vertex and pixel. The shared regression and all 19 CLI tests pass. The maintainers can choose the merge order. [Full check in #2787](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2787). Please retain the Git authors on pickup. If folding the integration or its test into another commit, use `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
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/2592/head:github-bot/gh-2592'
git switch 'github-bot/gh-2592'

Merge

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