CLI: reuse the D3D12 host across translation workers #1415
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!1415
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1415/head"
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?
@gurvancampion on GitHub · 2026-11-24 17:52 UTC · original
gurvancampion:topic/translate-shared-host→main· +130 −59 · 1 files · 1 commits · closed without mergingSummary
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.@Marvisak on GitHub · 2026-11-25 01:26 UTC · original · edited 2026-11-25 20:19 UTC
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
@Marvisak on GitHub · 2026-11-25 22:00 UTC · original
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