Make translate failure examples stable across workers #673
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!673
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-673"
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?
@timorjay on GitHub · 2026-11-24 06:35 UTC · original
timorjay:timorjay/translate-stable-failure-examples→main· +44 −10 · 1 files · 1 commits · openRunning
victory translateon the same input sometimes picks a different example for the same failure. Each worker kept the first label it saw, and the first worker to merge got to choose the example for the report. That makes otherwise identical reports harder to compare across machines.The tally now keeps the lexicographically smallest label among the failures it records for each reason. The same rule applies within a worker and when merging workers. The regression test covers both merge orders, with and without
--list.On Windows 11 I used one synthetic file containing 256 empty, 32-byte DXBC containers. At
d2a4bae, 32 identical runs with--jobs 4reported nine different example offsets. With this change, 32 runs each at 1, 4 and 12 workers all reported 256 failures and@0x0. Reversing two input file arguments with--listalso preserved both detail lines and the same example.cargo test --locked --workspace --no-fail-fastcompleted with 265 passed, 0 failed and 4 ignored. No game data was needed for these tests. OpenAI Codex (GPT-6) assisted with the patch, reproduction and report.@geiyiliyabumo on GitHub · 2026-11-24 10:09 UTC · original
Independent verification of
3ba3f79c1merged withmain(ffe310e, clean merge) on Windows 11 Pro (26100), Rust1.98.1(x86_64-pc-windows-msvc): PASS.cargo xtask policy→asset policy: 154 files okcargo clippy --workspace --all-targets --locked -- -D warnings→ pass (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings→ pass (0 warnings)cargo test -p victory --locked→ 2 passed, 0 failed (newtranslate::tests::failure_example_is_independent_of_worker_orderpasses across bothlistmodes and merge orders)Tally::record_failurecleanly selects the lexicographically smallest label both per-worker and duringTally::merge, making failure example reporting deterministic across worker counts and scheduling order.AI-assisted; synthetic tests only, no game files.
@ErRusso on GitHub · 2026-11-24 11:23 UTC · original
Audit: ✅ Looks good (needs Windows to fully compile)
Reviewed this PR as part of an audit of mergeable PRs.
apps/victory/src/translate.rs(+47/-10). Makes the stored failure example deterministic regardless of parallel worker order:fail()and the newrecord_failure()always keep the lexicographically smallest label, andmerge()usesrecord_failureinstead ofor_insert_withwhich had a race on the initial example. The new test verifies stability across worker order permutations (bothlistmodes, both merge orders, 4 variants).main.victorybinary crate's test suite depends onvictory-gpuwhich doesn't compile on Linux (pre-existing#[cfg(windows)]gating gap). The logic is straightforward and the test surface is self-contained intranslate.rs.No issues found in the diff.
@molodayamama on GitHub · 2026-11-24 14:02 UTC · original
Independent Windows check of
3ba3f79c1952da6db19fb7960a960e41d3e225c2(Windows 10 22H2 19045, Rust 1.98.1, MSVC x64).cargo test -p victory --locked --bin victory failure_example_is_independent_of_worker_order -- --test-threads=1 --nocapture: 1 passed.The fixture records translation-failure examples in different arrival orders and verifies that the output example is stable. No shader corpus used.
Only source-built synthetic fixtures were used. AI-assisted verification.
@Marvisak on GitHub · 2026-11-25 00:33 UTC · original · edited 2026-11-25 06:22 UTC
Automated triage for the maintainers.
Merge candidate. In
apps/victory/src/translate.rs,Tally::failandTally::mergenow both go throughrecord_failure, which keeps the smallest example label for each reason, so the reported example no longer depends on which worker saw or merged a failure first. The minimum over all failures does not depend on order, and the new testfailure_example_is_independent_of_worker_orderchecks this across both merge orders, with and without--list. Two small notes: the example closure is now always evaluated, not only on the first failure (a cheapformat!). Also, "smallest" means string order, so@0x10sorts before@0x2. That is still deterministic, which is the goal.Thanks for the rebase onto
940d32f. It merges cleanly and keeps the upstream dump-directory test, so this is the first content review.CI: passing (
check).Generated by Claude Code
@timorjay on GitHub · 2026-11-25 05:03 UTC · original
Rebased onto
940d32find2f4344. Both the upstream dump-directory test and the worker-order regression test are in the branch, and GitHub reports a clean merge withmain.Retested on Windows with synthetic inputs. All 11 unit tests for the
victoryCLI passed. For a file with 256 containers, all 96 runs selectedmany.bin@0x0(32 runs each with 1, 4, and 12 workers). Withz.binbeforea.bin, unmodifiedmainreportedz.bin@0x0. The rebased PR selecteda.bin@0x0in both input orders and kept the detailed output identical.The full workspace run on this machine had the same five test failures on both commits, two in
victory-gpuand three invictory-shader. The GitHub Actions check for this PR passed.@fuzeofficlal on GitHub · 2026-11-26 01:13 UTC · original
Code review and Windows 11 verification at head
d2f4344f726cmerged cleanly ontomain(63bcca43c6a0):apps/victory/src/translate.rs:69-140, 876-907):Tally::record_failure(used by bothfailandmerge) is associative and commutative, making the failure summary completely independent of worker scheduling/merge order while--listoutput remains sorted at line 312.cargo xtask policy:191 files ok;cargo clippy --locked -p victory --tests -- -D warnings: 0 warningscargo test --locked -p victory: 19/19 passed (15 unit + 4 integration, includingfailure_example_is_independent_of_worker_order).LGTM.
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.