Pre-build: 852 pipelines skipped as "rasteriser state not named"; the register images name all of them #2930
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#2930
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@zed6000 on GitHub · 2026-11-26 00:19 UTC · original
What happens
victory translate --cache --pipelines(main63bcca4, shaders 1.0.2.1, RX 7900 XTX) skips 1,029 of the pack's 28,164 pipelines. 852 of them areskipped: rasteriser state not named:Those 852 records (almost all mesh pipelines, with and without a pixel shader) use only 6 distinct rasteriser hashes; the pack has 18 in all and
Named::findnames 12. A run still has to compile those 852 pipelines while it plays.Why
The 6 have slope biases that
raster_spacedoesn't list, and 5 of them also have a non-zeroDepthBiasClamp, andpipelines.rsassumes "Rasterisers have no register image here". They do, though. In the same fixed partregisters()reads (from0x74/0xc8), the 7 words starting0x28are:+0x28PA_CL_CLIP_CNTLZCLIP_*_DISABLEbits (26, 27) clear+0x2cPA_SU_SC_MODE_CNTLCULL_FRONT→ 2,CULL_BACK→ 3, neither → 1; b2 =FACEclear (ccw)+0x30,+0x34+0x38PA_SU_POLY_OFFSET_CLAMP+0x3cPA_SU_POLY_OFFSET_FRONT_SCALE+0x40PA_SU_POLY_OFFSET_FRONT_OFFSETFill is solid throughout the pack (
POLY_MODE0). b13 (always 1), b14 and b15 are not in these words, so they're enumerated the waydepth_from_registershandles fields it can't see. Every candidate still has to match the record's CityHash64.I checked this against the pack. For all 24,619 records whose rasteriser
Named::findalready names, the description read from the registers is the named one in every field. For the 6 unnamed hashes it gives a description whose hash matches.Effect (measured)
With a
raster_from_registersnext todepth_from_registers/blend_from_registers, run fromname_from_registers:raster_space). Records with all three states named go from 24,477 to 25,329 of 25,471.Named::findtakes about the same time (~85 ms).translate --cache --pipelineson the same library:rasteriser state not nameddisappears (852 → 0). 447 pipelines were made, the rest of the 852 records were found in the library, and nothing was refused. The remaining skips are the 139 depth-stencil and 3 blend states, plus the shader causes.early-pipelines.txt) of an earlier run of the game on this machine, under the same key. The key includes the whole D3D12 rasteriser description, so that pipeline's derived description matches what the engine handed the device at run time, byte for byte.cargo test -p victory-gamepasses (17/0, including two new tests).cargo clippy -p victory-game -p victory --all-targets --locked -- -D warningsis clean.It doesn't conflict in purpose with #2575 / #2787 (stopping the enumerations once nothing is wanted). With every rasteriser named from the registers,
raster_spacewould stop at once there.I have this as a ~135-line patch to
crates/victory-game/src/pipelines.rs(the derivation, the doc comment's numbers, two unit tests) and can open it as a PR if that's welcome. Or it's small enough to take from the table above.Offline measurement and pipeline creation only; no shader names, hashes or game data.
@zed6000 on GitHub · 2026-11-26 00:25 UTC · original
Follow-up: the same approach covers almost all of the 139
depth-stencil state not namedrecords too. They use 13 hashes. Comparing whatdepth_from_registersproduces with the descriptions that do match shows three things the registers don't keep:DB_DEPTH_CONTROL'sDEPTH_BOUNDS_ENABLEis clear, and two have b14 = 1 (a byte the layout comment doesn't list yet). Both are tried as 0 and 1.DB_STENCILREFMASKholds write mask 0 where the description has 0xFF (or the read mask). Those are tried too.STENCIL_ENABLEclear,DB_DEPTH_CONTROL/DB_STENCIL_CONTROLstill hold the funcs and ops the engine's description names. The faces read from them are tried next to the D3D12 default faces.All are only candidates, so the CityHash64 still decides. Result on the pack:
main), andNamed::findstill takes ~88 ms.translate --cache --pipelinesnow skips 41 of 28,164 pipelines instead of 1,029: 3 depth-stencil, 3 blend, and the 35 shader causes (24 compute shaders that don't translate, 8 not found, 2 other stages, 1 pixel shader). Every pipeline it made was created; nothing was refused.cargo test -p victory-gameis 18/0 (plus a test for these cases), and clippy is clean.The two that are still unnamed (3 records) both have depth on and a stencil whose registers keep nothing it writes. A wider search over every op and func of both faces didn't match them either, so something else differs there.
Both changes together are about 220 lines in
crates/victory-game/src/pipelines.rs, and I'm happy to open them as a PR. Offline measurement and pipeline creation only; no names, hashes or game data.@kotekompotek on GitHub · 2026-11-26 00:28 UTC · original
The register-to-description table matches the
raster_spacefield layout, and the verification is airtight — 24,619 records already-named all agreeing field-for-field, plus the 852→0 measured result, is stronger evidence than most PRs arrive with. Please do open the patch as a PR: the*_from_registerspattern already has precedent indepth_from_registers/blend_from_registers, so the shape fits. The depth-stencil follow-up (unknown bits enumerated, CityHash64 still checked) is the same trick extended — worth its own PR after this one lands so each stays reviewable.@Marvisak on GitHub · 2026-11-26 00:42 UTC · original · edited 2026-11-26 06:42 UTC
Automated triage for the maintainers.
The premise matches
main: incrates/victory-game/src/pipelines.rs,name_from_registersderives depth and blend states from the register images (depth_from_registers,blend_from_registers), while rasterisers are left to the enumeration inraster_space, with the comment "Rasterisers have no register image here". Araster_from_registersalongside them, as proposed, fits the existing pattern, and the CityHash64 check still decides every candidate.The changes are now open as pull requests: #3047 (rasterisers from the register images) and #3048 (the depth-stencil follow-up, stacked on #3047). The decision is left to the maintainers; review continues there.
Generated by Claude Code
@zed6000 on GitHub · 2026-11-26 05:15 UTC · original
Opened as asked, as two PRs:
rasteriser state not named852 → 0).Together they take the pre-build from 1,029 skipped pipelines to 41 on
63bcca4. The measurements are in the PR descriptions and above.