Make translate failure examples stable across workers #673
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by timorjay on 2026-11-24T06:35:30Z.
Running
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.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:42:20Z.
Review: APPROVED
Verified locally on macOS 26 arm64, rustc 1.98.1 (aarch64-apple-darwin, rust-toolchain.toml):
Same setup as #664 (main's app crate doesn't compile on macOS; #235's head merged locally, uncommitted, additive conflict resolved):
cargo check -p victory --locked: cleancargo test -p victory --locked: 1 passed, 0 failed — the new stability test for translate failure examples passes.Approving.
Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:42:42Z.
Review: APPROVED
LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. cargo test -p victory passes cleanly (2 passed, including ailure_example_is_independent_of_worker_order). Keeping the lexicographically smallest label for each failure reason guarantees deterministic, reproducible translation error reports across multi-threaded workers.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T10:39:04Z.
Review: APPROVED
Tested
3ba3f79on Windows 11, RTX 5070, MSVC:cargo test -p victory2 passed, includingfailure_example_is_independent_of_worker_order. Clippy's 1 warning is the existingfield_reassign_with_defaultin victory-hle xmem.rs:747, not from this PR.record_failureis the single place that applies it.example()is now evaluated for every failure, even whenlistis off, where before it ran only the first time per reason. It's aformat!per refused program, so negligible next to the translation work.@0x10sorts before@0x9. That doesn't matter for determinism, just worth knowing if anyone expects the "lowest address".AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T10:09:38Z.
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.
Imported from Marvisak/VIctory. Originally posted by ErRusso on 2026-11-24T11:23:32Z.
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.
Imported from Marvisak/VIctory. Originally posted by molodayamama on 2026-11-24T14:02:29Z.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:33:57Z.
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
Imported from Marvisak/VIctory. Originally posted by timorjay on 2026-11-25T05:03:01Z.
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.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:13:06Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.