Skip to content

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

Open
fuzeofficlal wants to merge 1 commit into
Marvisak:mainfrom
fuzeofficlal:fix/cli-prebuild-reject-vs-plus-gs
Open

fuzeofficlal wants to merge 1 commit into
Marvisak:mainfrom
fuzeofficlal:fix/cli-prebuild-reject-vs-plus-gs

Conversation

@fuzeofficlal

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Owner

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

@futurepro62

Copy link
Copy Markdown

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

Tested

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.

github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 26, 2026
@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor

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 <andrewpozdnakov7-jpg@users.noreply.github.com>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants