Repository navigation
tooling: report a missing fxc instead of publishing a shader manifest without bytecode - #1662
Merged
Merged
Conversation
… without bytecode gfx2hlsl.translate_to skipped compilation when fxc.exe was not at the hard-coded SDK 10.0.26100.0 path and still published the manifest, so a cache run produced no .cso files and no error. find_fxc now tries X2W_FXC, that path, the newest installed Windows Kits bin version and PATH. When compilation is requested and none exists, the translation writes <key>.fail naming X2W_FXC and no manifest. X2W_FXC set to the empty string still skips compilation, as the DXC variants of startup_mrt_check use it.
tedin7
reviewed
Nov 24, 2026
tedin7
left a comment
Collaborator
There was a problem hiding this comment.
Peer review at head_sha: 4bbfee25be9fa8c8f56349833eecdc2d4ec35ed0
Findings
- P2 (
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
- Linux:
python3 -B tests/startup_translator_check.py: failed 1 check (FAIL find_fxc (PATH): got None, exit 1; see P2 above).- Local mutation check: temporarily replaced
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).
- Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
python3 -B tests/startup_translator_check.py: 0 failed (0.2s, exit 0).- Debug (
--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). - Release
/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.
shutil.which needs the execute bit outside Windows, so the PATH case of startup_translator_check failed in the Linux Python job.
Contributor
Author
|
Thanks for the review. The P2 finding (no execute bit on the AI-assisted. |
RenzoWit35
added a commit
to RenzoWit35/Xbox2Windows
that referenced
this pull request
Nov 24, 2026
Since R0Y00#1662 a request that translates is refused when no fxc.exe is found, so on a host without the Windows SDK the check's valid request got a .fail file instead of a manifest and the check failed. The check is about root signature parsing, not compilation: run the tool with the empty X2W_FXC, which publishes the manifest alone on every host, as the other startup checks do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 c864f13, 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.