Skip to content

translate: report the validator's own reason, not the line that hides it - #1767

Open
fiestorra wants to merge 1 commit into
Marvisak:mainfrom
fiestorra:cli/validator-first-error
Open

fiestorra wants to merge 1 commit into
Marvisak:mainfrom
fiestorra:cli/validator-first-error

Conversation

@fiestorra

Copy link
Copy Markdown
Contributor

The batch report kept the validator's least useful line

A whole-archive census on main (70564ae, translate --validate --list --jobs 10) refuses 1,114 of 25,899 programs, and 735 of them — two thirds of every refusal — were grouped under this reason:

validator: Function: main: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties.  See other errors for details.

The tool took only the first error line. The validator then says which stage, in an error the report discarded:

Function: main: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties.  See other errors for details.
Function: main: error: Function uses features incompatible with the shader stage (cs) of the entry function.
Validation failed.

(that text is what VICTORY_EMIT_DUMP=<dir> writes, and it is the only way to see it today).

The change

Tally's validator arm now reports every error the validator named, minus the line that only announces the refusal, plus a count of the rest:

fn validator_reason(text: &str) -> String {
    let errors: Vec<&str> = text
        .lines()
        .map(str::trim)
        .filter(|l| l.contains("error:") && !l.contains("See other errors for details"))
        .filter(|l| !l.contains("Entry function performs some operation"))
        .collect();
    ...
    format!("{} (and {more} more error{})", named[0], plural(more))
}

The count matters: one reported reason can stand for a program with several errors, and a fix that removes the first one is not a fix that makes the program pass.

Verification

Same archive, same command, before and after:

before  validator: ... Entry function performs some operation that is incompatible ... See other errors for details.   735
after   validator: ... Function uses features incompatible with the shader stage (cs) of the entry function.          735

The totals do not move — 24,785 validated, 1,114 refused, the same 25,899 programs — because this changes what is reported, not what is accepted.

What it immediately shows, and what comes next

The 735 are all compute, and with the stage named, one of them can be traced: CS_RaytracingResolve_* shaders are refused because the emitted module uses dx.op.sample (implicit derivatives) and dx.op.textureGather, which a compute shader cannot run. A dxc -dumpbin of one refused program shows exactly two dx.op.sample and four dx.op.textureGather calls among 117 SampleLevel ones — so the console's image_sample is being lowered as if it were a pixel shader's. On the console a compute image_sample has no derivatives and samples level 0, which is what SampleLevel with LOD 0 says. That is a translator fix, not a reporting one, and I will open it separately so this stays reviewable.

No game data is included: counts, error text and instructions only.

Written with an AI assistant.

@DesertGamer

Copy link
Copy Markdown

VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

@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: apps/victory is Windows-only — nothing compiles on macOS; source review of the diff.

translate now reports the validator's own reason instead of the line that hides it: validator_reason() extracts the meaningful part and plural() handles counts, with a_validator_refusal_is_reported_by_what_it_names test. Diagnostic-quality improvement for the translate CLI.

Every compute shader refusing validation reported the same unactionable
reason: 'Entry function performs some operation that is incompatible with
the shader stage or other entry properties. See other errors for details.'
The tool kept only the first error line, so the line it pointed at ('Function
uses features incompatible with the shader stage (cs) of the entry
function.') was discarded, and 735 of the 1114 refused programs in a whole
archive census were grouped under a reason that names nothing.

The reason is now every error the validator named, without the announcement
line, with a count of the rest so a fix that removes one error is not
mistaken for a fix that makes the program pass.
@fiestorra

Copy link
Copy Markdown
Contributor Author

One thing your helper drops that turned out to carry the answer: the note: line

I used this PR's idea (report what the validator actually says, not the line that hides it) in #2016, and while doing it I found that the useful line in one whole class of refusals is a note, not an error:

error: Flags must match usage.
note: Flags declared=1075314704, actual=1075380240

actual - declared = 65536 = 1 << 16, and bit 16 of the shader flags is "UAVs at every shader stage" in DXIL.rst. That difference was the whole of #1987 — 868 vertex programs refused because the write marking put a UAV into a stage that never had one. Without the note the line says nothing about which flag, which is why I spent four rounds guessing at bits before finding it.

Your filter keeps lines() containing error: and drops the announcement. The note: lines are neither, so they go too. If you are willing, keeping them is a small change and makes the reported reason self-explanatory for this class:

let errors: Vec<&str> = text
    .lines()
    .map(str::trim)
    .filter(|l| (l.contains("error:") || l.contains("note:"))
        && !l.contains("See other errors for details"))
    .filter(|l| !l.contains("Entry function performs some operation"))
    .collect();

The rest of your reasoning about the announcement line stands — it is exactly the line that hid the stage error in #1987's neighbour class, where the useful line was Function uses features incompatible with the shader stage (cs).

No conflict with #2016 needs resolving here: that PR appends the note inline, so whichever lands first the other's change is a two-line edit. I would rather your helper be the one that survives, because it collects all the errors and mine keeps one.

No game data is involved: validator text and flag values.

Written with an AI assistant.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. In the offline translate tool (apps/victory/src/translate.rs), the check tally now reports the validator's first specific error instead of the generic "Entry function performs some operation..." line, using a new validator_reason. This changes reporting only, and a unit test covers it on synthetic validator text. Small points, not blocking: the named dedup list is built but only named[0] is used, and the "(and N more errors)" suffix counts duplicate lines and splits the tally across keys when the extra-error count differs. CI passes.

Update after your reply: the head is still ef20af7, the commit reviewed above, and its diff has no note: handling. The change you describe has not reached this branch. If you push it, it will be reviewed then. Until then the verdict is for ef20af7 as it is.


Generated by Claude Code

@fiestorra

Copy link
Copy Markdown
Contributor Author

The note now travels with your reason, so #2016 no longer has to touch this file

I took up the suggestion from my comment above rather than leaving it for you to accept: validator_reason keeps the note: lines now, and reports the first of them with the first error:

validator: error: Flags must match usage. (note: Flags declared=1074790416, actual=1074855952)

That is the whole answer to #1987 in one line — the difference 65536 = 1 << 16 is the flag the module should have declared. Notes are not counted in the "and N more" tail, because they are not errors of their own; the code now splits kept into errors and the first note.

Measured over the local archive (26,503 containers, validator SDK 10.0.26100 1.9), the census line for the 867 programs that hit this reads that way instead of naming an error and hiding what the validator compared.

Why I touched your pull request rather than mine: #2016 carried the same note handling inline, which made the two conflict in translate.rs in either merge order. With the note here, #2016 is back to being only what the modules declare (shader.rs and its test), so the seventeen pull requests I have open now merge in any order with no conflicts at all — I re-ran the merge of the whole queue after both changes to confirm it.

Checked: cargo test -p victory --locked passes, rustfmt --check 0 hunks on the file, and the branch is MERGEABLE/CLEAN with a green run.

If you would rather keep your helper exactly as it was and have the note live in #2016 instead, say so and I will revert this in a minute — but I think it belongs here, because it is the same sentence: what the validator said.

No game data is involved: validator text, a flag value and counts.

Written with an AI assistant.

@StExpeditus

Copy link
Copy Markdown

Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at ef20af7. cargo test --workspace --locked --no-fail-fast -> 697 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.

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