Skip to content

CLI: separate root-signature failures in victory translate --pipelines (#885) - #2157

Closed
fuzeofficlal wants to merge 1 commit into
Marvisak:mainfrom
fuzeofficlal:fix/cli-translate-pipeline-stage-reasons-885
Closed

fuzeofficlal wants to merge 1 commit into
Marvisak:mainfrom
fuzeofficlal:fix/cli-translate-pipeline-stage-reasons-885

Conversation

@fuzeofficlal

@fuzeofficlal fuzeofficlal commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Separates root-signature serialization and creation failures from Create*PipelineState rejections in victory translate --pipelines (#885):

  • emit::host::Host::root_signature_for (crates/victory-shader/src/emit/host.rs) prefixes D3D12SerializeVersionedRootSignature and CreateRootSignature failures with root signature:, surfaces the serializer's error blob message (blob_err), and notes when the root-parameter dword total (user_data_dwords().max(1) per stage + 2 * views.len()) exceeds the 64-dword D3D12 root-signature budget on serializer errors while preserving the driver's own error on CreateRootSignature.
  • pipeline_failure (apps/victory/src/translate.rs) keeps root signature: failures in their own tally bucket rather than prefixing them with pipeline:, so 0x80070057 (E_INVALIDARG) from root-signature creation is not conflated with PSO rejection.

Verification

  • cargo test -p victory-shader --lib --locked -- host
  • cargo test -p victory --locked
  • cargo clippy --workspace --lib --tests --all-features --locked -- -D warnings
  • cargo xtask policy

Refs #885

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review only: CLI/translate path — the shader crate half compiles on macOS but this PR's change is apps-side error reporting.

Distinguish root-signature vs wave-lane failures in translate output — error-message clarity; mixed apps+shader.

@Dathinel

Copy link
Copy Markdown
Contributor

Checked the wave diagnostic against native Windows D3D12 on an RTX 3050 Laptop (driver 32.0.16.1062, 32-lane waves). I compiled three otherwise identical compute shaders with Windows SDK DXC 10.0.26100.0 (-T cs_6_6, [numthreads(64,1,1)], one UAV receiving WaveGetLaneCount()). All three embedded root signatures were accepted before checking pipeline creation.

Wave attribute Parent 940d32f PR 9771cae
None Pipeline created Pipeline created
[WaveSize(32)] Pipeline created Pipeline created
[WaveSize(64)] El parámetro no es correcto. shader requires 64-lane waves (device supports 32)

This also checks the parser against PSV0 emitted by SDK DXC, independently of the project's own emitter. The measurement ends at Host::compute_pipeline_with; I didn't dispatch the shaders or attribute any of the failures in #885 to this cause. AI-assisted.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f, cargo test -p victory-shader --locked.

144 passed / 0 failed / 2 ignored. translate errors distinguish root-signature vs wave-lane failures — shader crate side of the CLI diagnostics; apps half Windows-only.

RecompLive added a commit to RecompLive/victory-fork that referenced this pull request Nov 25, 2026
From Marvisak/VIctory#2157 (GPL-3.0-or-later, fuzeofficlal), adapted to
our tree (wave_lanes already returned Result, HostShader has min_lanes):

- Surface D3D12SerializeVersionedRootSignature's diagnostic blob, and say
  when CreateRootSignature fails over the 64-dword root budget
  ("root signature: N dwords exceeds the 64-dword limit").
- `translate` keeps `root signature:` failures in their own bucket instead
  of prefixing `pipeline:`.
- Report PSV0 wave-lane mismatches ("shader requires N-lane waves (device
  supports M)") before PSO creation, for compute, graphics and mesh.
- Tests: PSV0 range parse, mismatch format, bucketing; the WARP pipeline
  check skips where the host has no SM 6.6 WARP device (this PC).
@sinan-cmyk

Copy link
Copy Markdown

Offline measurement on a retail dump

Result: no count change against main.

I merged head 9771cae onto main 940d32f (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 23,918 on main, 23,918 with this PR.

No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. Thanks for c0b8b72. The PR is now limited to the root-signature part, so it no longer overlaps #223.

What it does, all in the offline victory translate / test host (emit::host::Host, crates/victory-shader/src/emit/host.rs):

  • root_signature_for prefixes serializer and CreateRootSignature errors with root signature:, and surfaces the serializer's own error text (blob_err).
  • CreateRootSignature failures keep the driver's message, as asked.
  • The over-budget note applies only to the serializer path, where the dword count is known. That count matches the parameters built just below: one root-constants parameter of user_data_dwords().max(1) per stage, plus 2 per root view.
  • pipeline_failure in apps/victory/src/translate.rs keeps these errors out of the pipeline: bucket.

The tests check both buckets, plus a real over-budget signature on WARP. CI check passes at c0b8b72.


Generated by Claude Code

@fuzeofficlal
fuzeofficlal force-pushed the fix/cli-translate-pipeline-stage-reasons-885 branch from 9771cae to c0b8b72 Compare November 25, 2026 12:00
@fuzeofficlal fuzeofficlal changed the title CLI: distinguish root-signature and wave-lane failures in translate --pipelines CLI: separate root-signature failures in victory translate --pipelines (#885) Nov 25, 2026
@fuzeofficlal

Copy link
Copy Markdown
Contributor Author

Updated in c0b8b72c per triage feedback:

  1. Removed the PSV0 wave-lane pre-check (psv_wave_range, wave_lane_mismatch, Host::wave_lanes, check_wave_lanes, and its tests) so this PR is focused solely on separating root signature: failures and avoids overlapping/conflicting with Shaders: translate for the host's wave sizes #223.
  2. Kept the driver's own error message on CreateRootSignature (format!("root signature: {}", err(e))) without guessing dwords > 64 there.
  3. Updated the PR title and description accordingly.

@fuzeofficlal
fuzeofficlal force-pushed the fix/cli-translate-pipeline-stage-reasons-885 branch from c0b8b72 to b0fbe25 Compare November 25, 2026 21:53
@Marvisak

Copy link
Copy Markdown
Owner

Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because no title program fails at root-signature creation on main, and the failures it was written for (#885's 328 compute E_INVALIDARG) are the 64-lane wave refusal that #2194 names directly. The two also clash: together the message becomes "pipeline: compute root signature: root signature: ..." and this PR's bucket test fails. The code itself is correct.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

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.

5 participants