tools: install the native graphics interface catalog at launch #3523

Manually merged
github merged 5 commits from github-bot/gh-3521 into main 2026-12-02 03:10:59 +00:00 AGit
Owner

@⁠Leyukaka on GitHub · 2026-11-29 21:36 UTC · original
Leyukaka:tools-run-interface-catalog → main · +242 −12 · 9 files · 5 commits · merged 2026-12-02 03:09 UTC

Refs #870.

Why

The native graphics interface catalog is only installed by hand, with compile_dxil --index-graphics-interfaces. Neither launcher nor the shared preset calls it. Without a catalog in the run's shader cache, every fixed slot-57 / PSI1 pixel entry is refused natively with fixed graphics entry requires matching stage interfaces.

In one long local run of the application, every native graphics attempt was refused this way. With a catalog built locally from the application's own shader archive, all of those pairs found both stages.

What

  • run.ps1 -InterfaceCorpus <dir> and run.sh --interface-corpus <dir> run the existing compile_dxil --index-graphics-interfaces <dir> <shader cache> from the selected build directory.
    • The install happens after fresh-cache handling and before the watcher and the debugger start.
    • A failed install stops the run. So does a failed fresh-cache rotation when a corpus is given.
    • The option requires -Render / --render. Without it, behaviour is unchanged.
  • run_preset.py forwards interface_corpus (--set interface_corpus=DIR). No preset layer sets a value; only the about string of run_presets.json changes. This is a per-run local input, not a tuning value, so it is not a shared preset entry.
  • docs/startup-runtime.md:
    • how to build a corpus from your own local package: tools/extract_shaders.py <archive> --format dxbc --stage vertex pixel mesh --output-dir <dir>, then rename the reviewed .dxbc containers to .cdxil, the only extension the indexer reads;
    • the corpus and the seeded cache must stay local;
    • the launcher, preset and manual install commands, and the output to check.

Tests

Run on Windows at 632fd625, dev preset; the last commit (efb468ca) changes only the docs.

Check Result
python -B tests/startup_run_preset_check.py OK, 12 preset choices
python -B tests/startup_run_ps1_check.py --text-only rc 0
ctest -R '^native_graphics_interface_library' Passed
python -B tests/startup_run_sh_check.py 77 (skipped on Windows)

native_graphics_interface_library now drives run.ps1 with the real indexer on the existing synthetic pair: rotation with -FreshShaderCache, catalog present before the watcher and the debugger, indexer count in the output, and a stop on a malformed corpus.

Mutations, each applied alone and restored:

  • 13 PowerShell and preset mutations are caught: 9 in run.ps1 (default value, install guard, block removed, block moved before the rotation, wrong cache, exit-code check removed, -Render guard, failed-rotation guard, indexer output dropped) and 4 in run_preset.py / run_presets.json (option removed, empty override forwarded, a value set in base.run, --print writing to the run root).
  • The 8 run.sh mutations in startup_run_sh_check.py were not executed: the check returns 77 on Windows. They need the Linux CI job.

The full startup_run_ps1_check.py (without --text-only) is flaky on this host under a French locale: 2 pass / 3 fail over 5 runs on the branch, 0 pass / 3 fail on base ff9dcef0. The only failure is the "stub exit 7" comparison, where the accented PowerShell error line is decoded differently.

Not covered

  • run.sh on Linux: not run here, neither the checks nor their mutations.
  • The next native refusals once the catalog is installed (fixed-entry layout) are claimed separately on #870 (comment 7262972255).
**@⁠Leyukaka** on GitHub · 2026-11-29 21:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3521) `Leyukaka:tools-run-interface-catalog` → `main` · +242 −12 · 9 files · 5 commits · merged 2026-12-02 03:09 UTC Refs #870. ## Why The native graphics interface catalog is only installed by hand, with `compile_dxil --index-graphics-interfaces`. Neither launcher nor the shared preset calls it. Without a catalog in the run's shader cache, every fixed slot-57 / `PSI1` pixel entry is refused natively with `fixed graphics entry requires matching stage interfaces`. In one long local run of the application, every native graphics attempt was refused this way. With a catalog built locally from the application's own shader archive, all of those pairs found both stages. ## What - `run.ps1 -InterfaceCorpus <dir>` and `run.sh --interface-corpus <dir>` run the existing `compile_dxil --index-graphics-interfaces <dir> <shader cache>` from the selected build directory. - The install happens after fresh-cache handling and before the watcher and the debugger start. - A failed install stops the run. So does a failed fresh-cache rotation when a corpus is given. - The option requires `-Render` / `--render`. Without it, behaviour is unchanged. - `run_preset.py` forwards `interface_corpus` (`--set interface_corpus=DIR`). No preset layer sets a value; only the `about` string of `run_presets.json` changes. This is a per-run local input, not a tuning value, so it is not a shared preset entry. - `docs/startup-runtime.md`: - how to build a corpus from your own local package: `tools/extract_shaders.py <archive> --format dxbc --stage vertex pixel mesh --output-dir <dir>`, then rename the reviewed `.dxbc` containers to `.cdxil`, the only extension the indexer reads; - the corpus and the seeded cache must stay local; - the launcher, preset and manual install commands, and the output to check. ## Tests Run on Windows at 632fd625, `dev` preset; the last commit (efb468ca) changes only the docs. | Check | Result | |---|---| | `python -B tests/startup_run_preset_check.py` | OK, 12 preset choices | | `python -B tests/startup_run_ps1_check.py --text-only` | rc 0 | | `ctest -R '^native_graphics_interface_library'` | Passed | | `python -B tests/startup_run_sh_check.py` | 77 (skipped on Windows) | `native_graphics_interface_library` now drives `run.ps1` with the real indexer on the existing synthetic pair: rotation with `-FreshShaderCache`, catalog present before the watcher and the debugger, indexer count in the output, and a stop on a malformed corpus. Mutations, each applied alone and restored: - 13 PowerShell and preset mutations are caught: 9 in `run.ps1` (default value, install guard, block removed, block moved before the rotation, wrong cache, exit-code check removed, `-Render` guard, failed-rotation guard, indexer output dropped) and 4 in `run_preset.py` / `run_presets.json` (option removed, empty override forwarded, a value set in `base.run`, `--print` writing to the run root). - The 8 `run.sh` mutations in `startup_run_sh_check.py` were not executed: the check returns 77 on Windows. They need the Linux CI job. The full `startup_run_ps1_check.py` (without `--text-only`) is flaky on this host under a French locale: 2 pass / 3 fail over 5 runs on the branch, 0 pass / 3 fail on base ff9dcef0. The only failure is the "stub exit 7" comparison, where the accented PowerShell error line is decoded differently. ## Not covered - `run.sh` on Linux: not run here, neither the checks nor their mutations. - The next native refusals once the catalog is installed (fixed-entry layout) are claimed separately on #870 (comment 7262972255).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 21:39:20 +00:00
Author
Owner

@⁠lukaslw-lab on GitHub · 2026-11-30 02:12 UTC · original · reviewed

Reviewed efb468ca by reading the diff, plus one local run with its run.ps1 (tests not run). Reads correct.

Run from a save, native-only, -InterfaceCorpus with all 23,619 vertex, pixel and mesh containers that the documented extract_shaders.py command wrote from a local package, renamed to .cdxil. Compared with an earlier run without a catalog (different build):

keys without with
refused fixed graphics entry requires matching stage interfaces 164 0
native graphics ready 2 19
refused for other reasons 3 31
  • Install cost: 252 s into an empty cache, 140 s into the same cache again, on every launch (run.ps1:88). Skip when the catalog is current, or document a one-time manual install?
  • All 23,619 indexed without error, so the docs' "rename the compatible guest containers" could say "all".
  • The run stopped at 158 s on the #3453 fault: native graphics now translates at draw time under draw_lock. #3518 covers that, not this PR.
**@⁠lukaslw-lab** on GitHub · 2026-11-30 02:12 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3521#pullrequestreview-6106132796) · **reviewed** Reviewed `efb468ca` by reading the diff, plus one local run with its `run.ps1` (tests not run). Reads correct. Run from a save, native-only, `-InterfaceCorpus` with all 23,619 vertex, pixel and mesh containers that the documented `extract_shaders.py` command wrote from a local package, renamed to `.cdxil`. Compared with an earlier run without a catalog (different build): | keys | without | with | |---|---|---| | refused `fixed graphics entry requires matching stage interfaces` | 164 | 0 | | native graphics ready | 2 | 19 | | refused for other reasons | 3 | 31 | - Install cost: 252 s into an empty cache, 140 s into the same cache again, on every launch (`run.ps1:88`). Skip when the catalog is current, or document a one-time manual install? - All 23,619 indexed without error, so the docs' "rename the compatible guest containers" could say "all". - The run stopped at 158 s on the #3453 fault: native graphics now translates at draw time under `draw_lock`. #3518 covers that, not this PR.
github-bot force-pushed github-bot/gh-3521 from efb468ca7d to ca2233e5ad 2026-12-01 17:40:38 +00:00 Compare
github manually merged commit cb3cde2662 into main 2026-12-02 03:10:59 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.