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

Merged
Leyukaka merged 5 commits from upstream-pr/3521 into main 2026-12-02 03:09:51 +00:00
Leyukaka commented 2026-11-29 21:36:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T21:36:15Z.


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).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5555373823 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3521). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T21:36:15Z. --- 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).
lukaslw-lab commented 2026-11-30 02:12:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T02:12:41Z.

Review: COMMENTED


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 #3451 fault: native graphics now translates at draw time under draw_lock. #3516 covers that, not this PR.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6106132796 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3521#pullrequestreview-6106132796). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-30T02:12:41Z. **Review:** COMMENTED --- 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 #3451 fault: native graphics now translates at draw time under `draw_lock`. #3516 covers that, not this PR.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!3521
No description provided.