Skip to content

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

Merged
R0Y00 merged 5 commits into
R0Y00:mainfrom
Leyukaka:tools-run-interface-catalog
Dec 2, 2026
Merged

R0Y00 merged 5 commits into
R0Y00:mainfrom
Leyukaka:tools-run-interface-catalog

Conversation

@Leyukaka

Copy link
Copy Markdown
Collaborator

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 632fd62, dev preset; the last commit (efb468c) 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 ff9dcef. 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 P0: main executable startup progress #870 (comment 7262972255).

@lukaslw-lab lukaslw-lab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Leyukaka
Leyukaka force-pushed the tools-run-interface-catalog branch from efb468c to ca2233e Compare December 1, 2026 17:35
@R0Y00
R0Y00 merged commit cb3cde2 into R0Y00:main Dec 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P0 Highest project priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants