Skip to content

compile_dxil: index the graphics interface catalog on several threads (--jobs) - #3539

Merged
tedin7 merged 1 commit into
R0Y00:mainfrom
lukaslw-lab:tooling/parallel-interface-index
Nov 30, 2026
Merged

tedin7 merged 1 commit into
R0Y00:mainfrom
lukaslw-lab:tooling/parallel-interface-index

Conversation

@lukaslw-lab

Copy link
Copy Markdown
Contributor

Change

compile_dxil --index-graphics-interfaces DIR CACHE [--jobs N] (1–64, default 1) indexes the reviewed containers on N threads. Fixes #3534.

  • Workers take files from a sorted list, then read, parse and publish each container (src/direct_compute_cache.cpp, index_graphics_interfaces).
  • Keys are merged afterwards in file order, so the catalog and its index are byte-identical for any N. The ambiguous-key rule does not depend on order.
  • The first failure in file order still fails the install, and no new index is written.
  • Without --jobs, the behaviour and output are unchanged. Other callers keep jobs = 1.

Related: #3521 runs this install at launch. Our #3472 adds --jobs to the compute pack in the same files, in other functions.

Verification

Commit a8a7b031 on Windows 10 22H2 (build 19045), Visual Studio 2026 18.12 (MSVC 19.52), Windows SDK 10.0.26100, CMake 4.3.1, Python 3.13.7.

ctest --test-dir out/build/release --no-tests=error -R '^(native_graphics_interface_library|native_compile_dxil_watch)$'
100% tests passed, 0 tests failed out of 2
ctest --test-dir out/build/dev --no-tests=error -R '^(native_graphics_interface_library|native_compile_dxil_watch)$'
100% tests passed, 0 tests failed out of 2

native_graphics_interface_library now installs its synthetic library once on one thread and once with --jobs 3, and compares the two interfaces/library trees byte for byte. That library includes the ambiguous embedded ID. The test also checks that --jobs 0 is refused and that a broken container still fails with --jobs 3.

Mutations, each applied alone, all caught by that test: errors from workers ignored; workers skipping every other file.

Timing on a local corpus of 23,619 vertex, pixel and mesh containers (from tools/extract_shaders.py), 8 logical CPUs, same code before the rebase onto d88f784b:

--jobs empty cache same cache again
1 261 s 140 s
4 62 s —
8 63 s 66 s

The 1-job and 8-job catalogs are identical (same catalog, same .index name, 23,014 files each).

Evidence and follow-up

  • Memory: workers keep only each file's id and keys, not the container. That is the same key set the one-thread map held. The merge is order-independent by construction, so no test can catch a merge in completion order, and none is needed. Duplicate containers (about 600 in the corpus) may publish the same .stage path concurrently, which publish() already handles.
  • Beyond 4 jobs this host gains nothing. The limit is probably file I/O, not tested further.
  • Docs: no page on main describes the install yet. tools: install the native graphics interface catalog at launch #3521 adds one, and --jobs can go there once both have landed.
  • Not covered: skipping the install when the catalog is already current (launcher side, raised on tools: install the native graphics interface catalog at launch #3521).

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC.

🤖 Generated with Claude Code

--index-graphics-interfaces DIR CACHE [--jobs N] (1-64, default 1). Workers
read, parse and publish the containers; their keys are merged afterwards in
sorted file order, so the catalog is byte-identical for any N. The first
failure in file order still fails the install before a new index is written.

Refs R0Y00#3534

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lukaslw-lab
lukaslw-lab force-pushed the tooling/parallel-interface-index branch from a8a7b03 to 81711d0 Compare November 30, 2026 09:38
@tedin7
tedin7 merged commit e441814 into R0Y00:main Nov 30, 2026
5 checks passed
@lukaslw-lab
lukaslw-lab deleted the tooling/parallel-interface-index branch November 30, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compile_dxil: index the graphics interface catalog on several threads (--jobs)

2 participants