tooling: report a missing fxc instead of publishing a shader manifest without bytecode #1655
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1662"
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 RenzoWit35 on 2026-11-24T16:40:56Z.
Change
tools/startup/gfx2hlsl.pycompiled the translated pair only whenos.path.exists(FXC), whereFXCdefaulted to the Windows SDK 10.0.26100.0 path. On a machine with another SDK version the compile was skipped silently and<key>.txtwas still published, so the runtime (which loads.vs.cso/.ps.cso) found no bytecode and nothing reported why.find_fxc():X2W_FXCif it is a file, else the previous default path, else the newest numericWindows Kits\10\bin\<version>\x64\fxc.exe, elsefxc.exeonPATH.translate_towithchecktrue and no fxc found writes<key>.fail("fxc.exe not found (X2W_FXC=...): set X2W_FXC ...") and publishes no manifest, returning that message as it does for a compile failure.X2W_FXCset to the empty string, orcheck=False, still publishes the manifest without bytecode. The DXC variant oftests/startup_mrt_check.pyruns--pendingthat way and compiles with DXC itself.docs/startup-runtime.md: theX2W_SHADER_CACHErow now describes the fxc lookup and the failure.Verification
On top of
c864f138, Windows 11, Python 3.14.5.python -B tests/startup_translator_check.py->startup translator checks: 0 failed(rc 0).Pipeline, temporaryWindows Kits-shaped tree,PATHemptied): missingX2W_FXCand no discovery gives.failnamingX2W_FXCand no.txt;check=Falseand emptyX2W_FXCpublish the manifest; discovery picks 10.0.26200.0 over 10.0.22621.0 and 10.0.9.0 (numeric, not string, order); explicitX2W_FXC; missing override falls back;PATH.fxc is Nonebranch disabled the check reportsFAIL missing fxc: result 'ok', files [...ps.hlsl, ...txt, ...vs.hlsl](rc 1); with the version sort ascending it reports twofind_fxcfailures (rc 1).X2W_FXC=C:\nope\fxc.exe,translate_toreturnsokwith files.ps.hlsl .txt .vs.hlsl, no.cso, no.fail.find_fxc()returns the installed SDK'sfxc.exeon this machine.tests/docs_links_check.pypasses.--pendingwith a real fxc (startup_stream_*and similar), which need the built consumers.Evidence and follow-up
Refs #870 (the report there of a cache run with no
.csofiles on a machine without fxc at the default path). Open PRs #1631, #1526 and #1277 touchgfx2hlsl.py; none of their diffs mentionsFXC,translate_toorX2W_FXC. A set but missingX2W_FXCfalls back to discovery and only fails when nothing is found; the message shows the configured value. Not measured: a full translation with a real fxc on a machine whose SDK differs from 10.0.26100.0.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T16:47:20Z.
Review: COMMENTED
Peer review at
head_sha:4bbfee25be9fa8c8f56349833eecdc2d4ec35ed0Findings
tests/startup_translator_check.py):check_fxc_discoverycreates the stubfxc.exeonPATHwithopen(os.path.join(on_path, 'fxc.exe'), 'w').close()without setting execute permissions (0o755). On Linux,shutil.which('fxc.exe')requiresos.X_OK, sopython3 -B tests/startup_translator_check.pyfails on Linux withFAIL find_fxc (PATH): got None. Addingos.chmod(..., 0o755)on that stub file fixes Linux execution while remaining safe on Windows.tools/startup/gfx2hlsl.pyanddocs/startup-runtime.md: no defects found (find_fxc()search order,X2W_FXC=''manifest-only behavior, and<key>.failreporting whenfxc.exeis missing all match the documented contract). Title-neutrality clean.Verification
python3 -B tests/startup_translator_check.py: failed 1 check (FAIL find_fxc (PATH): got None, exit 1; see P2 above).if fxc is None:withif False:intools/startup/gfx2hlsl.pyand ranpython3 -B tests/startup_translator_check.py— failed as expected (FAIL missing fxc: result 'ok', files ['0000000000001234.ps.hlsl', '0000000000001234.txt', '0000000000001234.vs.hlsl'], exit 1); restored cleanly (git status --shortclean).python3 -B tests/startup_translator_check.py: 0 failed (0.2s, exit 0).--preset dev):cmake --build --preset dev --target offscreen_check -- -j 6(22.41s);ctest --preset dev -R '^startup_translator$' --parallel 4 --no-tests=error --output-on-failure: 1/1 passed (0.27s)./O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 6(24.66s);ctest --preset release -R '^startup_translator$' --parallel 4 --no-tests=error --output-on-failure: 1/1 passed (0.25s).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-24T16:52:31Z.
Thanks for the review. The P2 finding (no execute bit on the
PATHstub, soshutil.whichreturns nothing outside Windows) is fixed in50cd06c8, which addsos.chmod(..., 0o755)on that stub. The Linux Python job passes on that commit;python -B tests/startup_translator_check.pystill reports 0 failed on Windows.AI-assisted.