tools: cargo xtask refusals <log> says what a run lost, and why #2892
No reviewers
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!2892
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2892"
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?
@HoLa-Lee on GitHub · 2026-11-25 23:15 UTC · original
HoLa-Lee:tools/xtask-refusals→main· +323 −0 · 2 files · 1 commits · openWhat this adds
cargo xtask refusals <log>— one command that says what a run lost and why, grouped, most frequent first. A run names four kinds of loss, each on its own line, thousands of frame lines apart:host pipeline refused error=… shaders=[…](and themesh,graphics,root signatureforms)D3D12: … id=… severity=…VICTORY_D3D12_DEBUG=1shader does not translate; … stage=… hash=… error=…dropped …/frame without a host pipeline: …On a real run, from this machine
240 s of the intro with the debug layer on (RTX 4080 SUPER):
Over a run without the debug layer it prints the same shape and says plainly that
VICTORY_D3D12_DEBUG=1is what supplies the reasons, rather than leaving a reader to wonder whether nothing was wrong.Shape
parse(&str) -> Reportis a pure function of the log's text:BTreeMaps of refusals (kind, shaders, error), debug messages (text, id, severity), untranslated shaders (stage, hash, error), and drop reasons with the highest rate seen. Nothing touches the filesystem or a GPU.stage="compute"quoting and the "name the switch" path are all pinned.cargo test -p xtask: 8 passed (6 policy, 2 new).cargo clippy -p xtask --all-targets -- -D warnings: clean.Why not a script
The same parsing is what a reviewer wants over a pasted log, it has to survive ten thousand lines and group by keys, and
xtaskis where this repository keeps its maintenance subcommands (policy). No workspace behaviour changes: this only reads a file.Found while chasing the card's refused pipelines (four separate costs: wave64 shaders, an
R8_UINTblend, the 1,000,000-view heap cap, and the deliberately-off ray-tracing builder). The tool exists so the next session does not have to find them again by hand.cargo xtask refusals <log>says what a run lost, and why dc7d199594A run names four kinds of loss, each on its own line, thousands of frame lines apart: a host pipeline the device refused, the debug layer's own words for it (only with `VICTORY_D3D12_DEBUG=1`), a shader the translator cannot express at all, and the draws and dispatches dropped a frame for want of a pipeline, by reason. Reading them off a log by hand is how a session gets spent. `cargo xtask refusals <log>` prints them grouped, most frequent first, and says what to turn on when the reasons are missing. On this machine, one command over a 240 s run with the debug layer on (RTX 4080 SUPER): refused pipelines (8 kinds) 1x [compute 02384a60fda6f2d0] 参数错误。 (0x80070057) ... 1x [mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35] 参数错误。 (0x80070057) the debug layer's reasons (14 kinds) 6x id=622 severity=1: ID3D12Device::CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32. ... 1x id=645 severity=1: ID3D12Device::CreateDescriptorHeap: ... NumDescriptors 2097152, but the limit for shader visible view heaps is 1000000 shaders that do not translate (2 kinds) 1x stage=compute hash=926c46bab3b86bd6 converter shader.dxil v1: GFX10 code at 0x13c8: a lane mask holding lanes elsewhere read as data is not supported dropped a frame for want of a host pipeline, by reason 1412.0/frame at most: a stage of the ray-tracing structure builder, which is off 2.0/frame at most: refused [compute 02384a60fda6f2d0] and over a run without the debug layer, the same shape with the note that `VICTORY_D3D12_DEBUG=1` is what gives the reasons. Why in `xtask` and not a script: the checks a run's log needs are the same checks a reviewer wants on a pasted log, they group by keys, and they have to survive ten thousand lines. The parsing is a pure function of the text with two unit tests over a synthetic log - one with the debug layer's messages, one without - so its shape is pinned without a GPU. Nothing in the workspace changes: this only reads a file.dc7d199594tob040e48609@Marvisak on GitHub · 2026-11-26 04:30 UTC · original · edited 2026-11-26 05:34 UTC
Automated triage for the maintainers.
Needs work. Thanks for the follow-up; most of the earlier points are addressed in
b040e48: the nonexistenthost graphics pipeline refusedshape is gone,renderreturns aStringand both hint tests now assert the text. A few things remain:drive_card.ps1is still named in theRefusalsdoc comment inxtask/src/main.rs(/// ... e.g. a drive_card.ps1 tag's .err.log); please drop it there too.Report::unparsedis never incremented anywhere inrefusals.rs, so the "could not be read whole" line can never print. Either count lines that match a refusal prefix but fail to parse, or remove the field and that branch.shader does not translate(victory-gpu/src/pipeline.rs) logscached,ms,user_ms,kernel_msaftererror, soread_untranslatedtakeserror=to end of line and folds those timings into the key; the same shader with different timings is counted as different kinds. The fixture line is cut aftererror=, which hides this. Please stop the error atcached=and use a fixture shaped like the real line. Likewise the fixture'smessages=Noneis not a field main logs.host root signature refusedinpipeline/host.rsdoes log?shaders, so in practice it carries ashaders=[...]list; fine to keep the fallback, but the comment saying it "names no shaders at all" is not accurate.Whether a log-analysis command belongs in
xtaskis still the maintainer's call.CI: not run on this head.
Generated by Claude Code
@HoLa-Lee on GitHub · 2026-11-26 04:48 UTC · original
All five points are in,
b040e48(rebased onto63bcca4, still two files:xtask/src/main.rs+11,xtask/src/refusals.rs+302).host graphics pipeline refusedremoved - you are right, nothing in main logs it. The three shapes left arehost pipeline refused,host mesh pipeline refused,host root signature refused.shaders=[is now read, not counted as unparsed:push_refusaltreats a missing shader list as an empty one, and the report names such a refusal by its kind. The fixture line you asked for is inLOGand the test asserts both the entry and that the rendering says[root signature].drive_card.ps1is gone from the doc comments (it lives in our fork, not here - my mistake to mention it).printisrender(&Report) -> String(printis one line that prints it), anda_log_without_reasons_says_what_to_turn_onasserts the string containsVICTORY_D3D12_DEBUG=1. A new test pins the empty-log sentence.One thing worth flagging on myself: while making these changes I amended on the old base and force-pushed, which briefly made the PR show your
63bcca4work as deletions (64 files, -9,562). It is rebased and pushed again (b040e48, two files,mergeable=True); nothing of yours was touched, but a list-only review of this PR between those two pushes would have been misleading.On your last question - whether a log-analysis tool belongs in
xtask: that is yours to decide and I will not push for it. If the answer is no, the same file works as a standalone example in the issue thread, and I will close the PR rather than argue.cargo test -p xtask: 9 passed.cargo clippy -p xtask --all-targets -- -D warnings: clean.b040e48609to783e1369bc@fuzeofficlal on GitHub · 2026-11-25 23:32 UTC · original · reviewed
Verified head
dc7d1995cleanly on top oforigin/main(842b0cb7) on Windows 11 x64.Findings
read_untranslatedwon't aggregate identical untranslated shaders on real logs (xtask/src/refusals.rs:123-126):crates/victory-gpu/src/pipeline.rs:130-139emits trailing fields aftererror=%e(cached=... ms=... user_ms=... kernel_ms=...). Becauseread_untranslatedslices fromrest.split_once("error=")to the end of the line, any difference inms=/user_ms=produces a distinctUntranslated.errorkey and prevents grouping identical shaders (the unit test fixture truncates right aftererror=..., so it doesn't catch this). Trimming atcached=(or parsing structured trailing fields) fixes aggregation on real runs.debugorunparsedentries exist (xtask/src/refusals.rs:171): Whenrefusals,untranslated, anddropsare all empty butdebugis non-empty orunparsed > 0, the report still prints"nothing refused, dropped, or untranslated in this log"immediately before printing the D3D12 debug layer or unparsed sections.pipeline/host.rs:657logs"host pipeline refused"(not"host graphics pipeline refused"), so graphics and compute pipelines both fall underkind = "pipeline"(distinguishable viashaders).read_debugformats missingid=/severity=asu64::MAX(18446744073709551615).Local Verification
cargo test --locked -p xtask: 8/8 passed (including the 2 new tests andrepository_passes_policy).cargo clippy --locked -p xtask --tests -- -D warnings,cargo xtask policy, andcargo xtask refusals --help: clean.refusals.rsuses onlystd+anyhow(no platform-specific dependencies).@kotekompotek on GitHub · 2026-11-25 23:36 UTC · original · reviewed
Useful triage tooling — the four refusal classes it groups (device-refused pipelines, debug-layer reasons, untranslatable shaders, per-frame drops) are exactly what gets lost in a frame-line flood. Additive, no runtime surface. LGTM.
@HoLa-Lee on GitHub · 2026-11-26 12:15 UTC · original
All four are in,
783e136(two files, +323/-0, rebased on63bcca4).drive_card.ps1is gone from theRefusalsdoc comment; the parameter now says what it is ("the diagnostics output of one run, e.g. the file a launcher keeps of its stderr").Report::unparsedis removed, with the render branch that could never fire -push_refusalalways produces a refusal now, so there was nothing for the field to count.cached=, and the fixture is shaped like the real line:stage="compute" hash=… error=… cached=false ms=12 user_ms=11 kernel_ms=1, twice with different timings, and the test asserts that the two are one kind and thatcached=never reaches the key.messages=Noneis gone from the fixture too.?shaders, so the fixture now carries a shader list and the test reads it; the no-list path stays as a fallback and says so.One more thing the fixture was hiding, now covered: the drop line.
LOGhasdropped 227.7/frame without a host pipeline: …and the test asserts the rate is read off the line rather than left at 0.0, which is whatread_dropexists for.On whether it belongs in
xtask: still yours to decide, and if the answer is no I will close it rather than argue - the parsing is one file and travels well.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.