CLI: reuse the D3D12 host across translation workers #1414
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1415"
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 gurvancampion on 2026-11-24T17:52:52Z.
Summary
victory translate --pipelinesnow opens one D3D12 host and builds one pixel stub before scanning files. Each worker borrows both, andVICTORY_PAIRSreuses the host after the workers finish. Initialization errors reach the caller before the scan. ExplicitVICTORY_WARP=1runs serialize pipeline creation while translation and DXIL validation remain parallel.Evidence
Base
ffe310eand head61f2848ran under GE-Proton11-12 with GPU and display access disabled. The regression test scans two synthetic files with two workers per file. The base control mirrors the old initialization order and fails with five initializations. Head passes with one and verifies that all four workers receive the same value.cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warningscargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warningscargo xwin test -p victory --locked --target x86_64-pc-windows-msvc translate::tests::shares_pipeline_checks_across_files_and_workerscargo xwin test -p victory --locked --target x86_64-pc-windows-msvccargo xwin test --workspace --locked --target x86_64-pc-windows-msvc --no-fail-fastcargo xwin test --workspace --all-features --locked --target x86_64-pc-windows-msvc --no-fail-fastcargo test -p victory-core -p victory-formats -p victory-game -p victory-pipeline -p victory-shader -p xtask --lockedcargo test -p victory-core -p victory-formats -p victory-game -p victory-pipeline -p victory-shader -p xtask --all-features --lockedcargo test -p xtask --locked repository_passes_policycargo xtask policy --stagedcargo fmt --all -- --checkrustfmt --check --edition 2024 apps/victory/src/translate.rsgit diff --check origin/main HEADThe unfiltered Windows failures require a D3D12 SM 6.6 device, a window, a missing Wine export, a working probe build path, or Git in the guest. Filtering those 20 tests passed both feature sets on both revisions.
Not verified
Native Windows, hardware and WARP pipeline creation, and scan timings remain unverified under the GPU halt. The WARP lock addresses the explicit software-adapter path described in the upstream concurrency report. PR #244
Merge Danger
Door Two-way. Reverting restores the previous host lifetime. The change involves no persisted state.
Blast Radius Local. The device lifetime affects the offline pipeline checks in
victory translate, including the final pair pass when--pipelinesis set.AI disclosure
OpenAI Codex (
gpt-6.2-sol) traced the call paths, implemented the change and regression test, ran verification, and drafted this description. Antigravity (Gemini 4 Neon) coordinated and reviewed the diff. The author reviewed the diff and description before opening the PR.Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T17:56:55Z.
Review: APPROVED
Tested merged cleanly onto
main(ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):cargo test -p victory: 2 passed, 0 failedcargo clippy -p victory --all-targets: 0 warningscargo xtask policy: okClean CLI improvement reusing the D3D12 host across translation workers. Approving.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:26:28Z.
Automated triage for the maintainers.
Merge candidate (unchanged). The new head
3ebc8e8is a plain rebase ontomain(67e8ae1).git range-diffshows the patch is identical to the previously reviewed8668932.main's changes since then tocrates/victory-shader/src/emit/host.rsare test-harness additions that don't touchHost::newor pipeline creation. So the earlier review still holds:scaninapps/victory/src/translate.rsbuilds oneHostand stub pixel shader before the walk, returns a creation error instead of silently dropping the checks, and lends both to every worker and toVICTORY_PAIRS.Minor, still not blocking: the test's temp directory is named by process id and made with
create_dir, so a directory left over from an aborted run would fail it.CI: passing.
Generated by Claude Code
upstream-sync referenced this pull request2026-11-25 14:07:24 +00:00
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:00:55Z.
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing because
mainalready has its effects.translatecreates aHostonce up front and fails if that fails. D3D12 devices are per-adapter singletons, so the workers of a file already share one device, and this only saves a device re-creation per file. The WARP serialisation is done more completely by #244 (now merged), which locks insideHostfor every caller. The new test checks thatscancalls its factory once, which is the new plumbing rather than a defect ofmain.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed