tooling: resume startup shader compilation after manifest-only runs #2001
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2008"
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 R0Y00/Xbox2Windows. Originally posted by avt0m4t48 on 2026-11-24T22:59:34Z.
Change
An explicit manifest-only pass (
X2W_FXC=) produces a manifest and HLSL without compiled shader stages. A later--pendingrun with FXC enabled now compiles requests missing either nonempty stage, while a manifest-only pass can still skip an existing manifest.The translator stages both FXC outputs before publishing either. When the manifest bindings change, it withdraws the old manifest before publishing bytecode and writes the new manifest last. A successful compile clears an earlier
.failreport. Restart an already-running runtime if it previously read the manifest before bytecode was available.This covers the one-shot path on
main. The pending-candidate selection in #1749 touches the same completion rule and will need the compiled-mode check if the changes are combined.Verification
python3 -B tests/startup_translator_check.pyreproduced the skip on the base and passed with the patch. It covers manifest-only skips, unsuccessful pixel compilation, retry, complete-cache skips, an empty bytecode file, and an interrupted manifest publication.Native Windows FXC and D3D12 execution were outside this run.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T23:11:55Z.
Ran it, broke the publish state machine five ways — all caught
Windows 11 build 26300.9974, device-free:
has_bytecodeaccepts an empty file (getsize > 0dropped).failis not cleared after a successful compileThe fourth is the one I expected to slip, because emptying the loop still leaves a valid manifest and a successful return — and it is caught. That
means the fixture drives a real re-compile path rather than only the
--pendingselection.The ordering is the part worth defending
Three separate claims are encoded in the new shape, and each failed on its own above:
os.replace, so a crash leaves the old manifest rather than a truncated one.That is one invariant — "a manifest on disk always describes bytecode on disk" — split across three call sites, and it would be reasonable to say so
in the comment, because a future edit that moves any one of the three breaks the invariant without breaking any single test.
A note on
has_bytecodeTreating a zero-byte
.csoas missing is right: an interrupted FXC leaves exactly that, and the oldos.path.existswould have skipped the requestforever. The
except OSError: return Falseis also right for a file removed between the check and the size read.Merge with current
mainYour branch predates #1992, so a plain diff shows its six
VEC_Uentries as deletions. The actual merge is clean and both suites pass:Scope, and the caveat you already wrote
I did not exercise a real FXC run: no
fxc.exeon this machine, so what is verified is the file-state machine, not a compiled pair. Your own note that#1749's pending-candidate selection touches the same completion rule is the right thing to flag — combining the two would need the compiled-mode
check on that path as well, and the check I ran would not tell you.
Notes