Skip to content

startup: dispatch translated compute programs with raw table buffers - #2470

Open
NiiRoZz wants to merge 31 commits into
R0Y00:mainfrom
NiiRoZz:startup/compute-dispatch-translated
Open

NiiRoZz wants to merge 31 commits into
R0Y00:mainfrom
NiiRoZz:startup/compute-dispatch-translated

Conversation

@NiiRoZz

@NiiRoZz NiiRoZz commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Depends on #1803, #1974 (both closed for now by their author to shorten the test queue, to be reopened) and #1975. This branch contains merges of those three, so the diff here includes them until they land; the new code is the last two commits.

What / Why

A device slot 67 compute pipeline is a placeholder: its request is published and translated offline
(stage cs manifest and cs_6_0 bytecode), but nothing ran the result. Command-list slot 14 refused every
Dispatch with such a pipeline bound. This change runs the translated program for the narrowest case: raw buffer
inputs and outputs named by hardware buffer descriptors in the compute descriptor tables, with entry values from
compute root constants. Everything else is refused with one logged reason and records nothing on the desktop
list.

Change

  • publish_compute_request returns the request key; the slot 67 wrapper keeps it together with the root
    signature wrapper its description names.
  • New src/startup_stubs/d3d12_compute_dispatch.inl:
    • loader for x2w-manifest 2 / stage cs: accepts group, ud, udsrc i rootconst p w,
      srv i buf table p b, uav i table p b; any other line leaves the pipeline untranslated with one logged
      reason. An absent manifest is retried once per second, as for draws.
    • host root signature through create_translated_root, which gains an optional UAV range after the SRV range
      in the same table (graphics callers are unchanged).
    • dispatch_translated, called first in list_dispatch: resolves every view before recording anything
      (inputs through indirect_table_buffer; outputs must be placed buffers that alias the caller's memory, allow
      unordered access, start in COMMON and are not also an input), then states, descriptors in the draw heap ring,
      constants from the recorded compute root constants, Dispatch, a UAV barrier per output, and the title's
      desktop compute root and upload SRVs restored. The desktop-pipeline decision of startup: implement command-list slot 14 Dispatch (Part of #870) #1974 is untouched and still
      handles every pipeline that is not a slot 67 placeholder.
  • Log line after the render totals:
    x2w-render compute dispatches: translated <n>, refused <n>, no translation <n>.
  • tests/startup_stream_consumer.cpp: slot67 ... dispatch|dispatch-none|dispatch-swapped records the heap,
    pipeline, root, constants, table and Dispatch on a stand-in list and writes the output words read from the
    aliased memory.
  • docs/experiments.md: section "Translated compute Dispatch".

Tests

Commit under test: aca6e895 (local; the neighbour run below was made at 1e567a02, before a log-only follow-up, and
the two new tests were rerun at this commit). Windows 11 build 26300. Debug layer enabled in the new tests
(X2W_D3D12_DEBUG=1); its messages are drained into the log at the Dispatch and after the queue's execute, and
none is an error or corruption message. No probe showed that a wrong state would be reported there.

cmake --build --preset dev
ctest --preset dev --no-tests=error -R "^startup_compute_dispatch_" -V
  • startup_compute_dispatch_warp: Passed. Microsoft Basic Render Driver, driver 10.0.26100.10068.
  • startup_compute_dispatch_hardware: Passed. NVIDIA GeForce RTX 5090, driver 32.0.16.2135.

Each run checks, on one cache: before translation the Dispatch is refused with "no translation" and all 320
output words keep the sentinel (negative control: the test fails if nothing translated is dispatched); after
gfx2hlsl.py --pending all 320 words equal the fixture's expectation; with no Dispatch recorded the output is
untouched; with the two descriptors exchanged the Dispatch is refused with one reason, the output is untouched
and the input is unchanged.

ctest --preset dev --no-tests=error -R 'startup_list_dispatch|startup_compute|startup_root_constant|startup_gfx2hlsl_compute|startup_indirect|era_heap|desktop_root_signature|startup_stream|docs_links|startup_draw|startup_logical'

178 selected: 177 passed, 0 failed, 1 capability skip (startup_logical_view_warp: the adapter accepts the
descriptor count directly, so that test has nothing to check; unrelated to this change). Before the change the
same build passed 162 of 162 on the narrower filter without the last three alternatives.

Limits

🤖 Generated with Claude Code

tedin7 and others added 20 commits November 24, 2026 19:53
…33 and 35)

Header-only state in list_compute_root.h with a Linux-testable check. Dispatch (slot 14) is not handled here; the state is exposed through ready() and table() for it. Refs R0Y00#870.
Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them.
Part of R0Y00#870. Forward Dispatch only with a desktop compute pipeline and root
bound and group counts within 65535 per axis; refuse otherwise.
…t against the bound root

Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused.
Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them.
Part of R0Y00#870. Forward Dispatch only with a desktop compute pipeline and root
bound and group counts within 65535 per axis; refuse otherwise.
…t against the bound root

Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused.
Conflicts in d3d12_xs_device.cpp and docs/experiments.md resolved by keeping both sides: the pipeline root
out-parameter of the stream builder next to the cached-mesh root, the bound root SRV mask next to the recorded
upload SRV addresses, and both table entries and document sections.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Conflicts in d3d12_draw.inl and d3d12_xs_device.cpp resolved by keeping both sides: graphics root constants
go through the shared store and still mark the words a slot 40 call set.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A device slot 67 placeholder keeps the key of its published request. At
list slot 14 the stand-in loads the stage cs manifest and compiled
program for that key and records the dispatch: raw buffer inputs and
outputs from hardware descriptors in the recorded compute tables, entry
values from the recorded compute root constants. Other manifest lines
leave the pipeline untranslated; a dispatch that cannot be bound
completely is refused with one logged reason and records nothing.

startup_compute_dispatch_{warp,hardware} drives a source-built program
through the stand-in list and reads the output back, with controls
before translation, without a Dispatch and for a refused output.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Dispatches that arrive before the offline translation no longer use up
the lines kept for refusals at bind time.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review of head aca6e895 (code read only; no Windows run by me).

What I checked

  • Scope: the diff against main also carries merges of #1803, #1974 and #1975. The new code is the last two commits (8 files, +435/-9): d3d12_compute_dispatch.inl, small hooks in d3d12_draw.inl / d3d12_xs_device.cpp / translated_sampler_bindings.h, the consumer record mode, a new check script, docs.
  • Dependencies: the body says "depends on #1803, #1974, #1975". #1803 and #1974 are CLOSED (not merged), #1975 is OPEN. So this cannot land as it is; the author says the merges must be redone before opening.
  • Test design (tests/startup_compute_dispatch_check.py): it has a negative control (before translation the Dispatch is refused with "no translation" and all 320 words keep the sentinel), a no-Dispatch control, and a swapped-descriptor refusal control, and compares all 320 output words with the fixture expectation. This is the shape a source-built regression test plus negative control should have.
  • Not provable by me: the test needs DXC and a Windows D3D12 adapter, so I could not run it or mutate the code under test on Linux.
  • Windows results: the body reports the two new tests at aca6e895 (WARP and hardware), but the neighbour ctest run (177/178) was made at 1e567a02, before the last log-only commit. I did not verify any of these numbers.
  • Startup: the body does not claim startup progress, and no game result is posted on this head. Nothing here is verified against the game.

Local commands run

  • git diff --check origin/main...HEAD (clean)
  • python3 tests/docs_links_check.py (passed, 19 files, 465 links)
  • python3 tests/bidi_controls_check.py (passed)

Open points for @R0Y00

  • Whether to take the stacked #1803/#1974/#1975 work first, or this PR as one unit. I leave that choice to you.
  • After the dependencies land, the branch needs a fresh Windows run on the final head.

AI-assisted; commands listed were executed locally.

NiiRoZz and others added 2 commits November 25, 2026 19:56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MasterDomino

Copy link
Copy Markdown
Collaborator

Thanks, @chasegrindy, that's a real gap, and it fits what I saw on #1803: the mutant that removes the heap-change clear in slot 32 survived every fixture. Now that #1803 is on main, the bug is in main.

On where it goes, I'd say:

  • The recorder fix as its own PR against main, with its CPU tests. It fixes code that's already merged, so it doesn't have to wait for this chain. It should keep the graphics lookup policy as it is, track the compute view heap's identity for both ordinary and oversized heaps, and keep slot 35 when the same heap is set again, as you describe.
  • The three Dispatch controls carried in the trimmed startup: dispatch translated compute programs with raw table buffers #2470, since that's where the real consumer is: the nonzero index with swapped descriptors, root change and back, and the ordinary view-heap switch. That's the end-to-end requirement @R0Y00 set before startup: dispatch translated compute programs with raw table buffers #2470 lands. If @NiiRoZz agrees, your fixture patch could go onto his branch once the recorder fix is on main.

@R0Y00, does that split work for you? Once both are up, I can rerun the mutants on the RX 9070 XT.

AI-assisted.

R0Y00 commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Yes, please use that split. The recorder fix can go directly against main and keep graphics lookup unchanged. Its controls should cover ordinary and oversized view heaps, preserving slot 35 when the same heap is rebound and invalidating it when another heap is selected. In the trimmed #2470 consumer, keep the fenced nonzero/swapped descriptor readbacks plus root-change-and-back and ordinary heap-change cases that restore constants without restoring the table. Please coordinate the fixture commit with @NiiRoZz and preserve its authorship. #1974’s native forwarding fixture and the existing merge order still apply.

…tch-translated

# Conflicts:
#	docs/experiments.md
@chasegrindy

Copy link
Copy Markdown
Contributor

Thanks, @R0Y00 and @MasterDomino. The recorder fix and its CPU tests are in #2636; the Dispatch tests are separate.

@NiiRoZz, are you already working on the three slot-35 Dispatch checks? If not, I can send a test-only commit for you to cherry-pick after the recorder fix lands on main. On 9caf8fd5, the three checks passed on RX 7900 XTX and WARP with the recorder fix applied. The fixture does not touch #1974’s forwarding path.

AI-assisted (GPT-6.2-sol). Tests ran locally with synthetic inputs.

R0Y00 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

The separate slot 35 recorder fix #2636 is on main at 1cd73d3a. The recorder checks passed on WARP and RTX 4060 Laptop, and restoring the old oversized-only filter failed the ordinary-to-ordinary invalidation check. The recorder dependency is ready for the Dispatch fixture handoff in this PR. Please keep the author’s commit when bringing the three controls over. #1974 and #1975 still precede the trimmed #2470 production diff.

@MasterDomino

Copy link
Copy Markdown
Collaborator

Preview executable run for this stack, ahead of the trim. It covers the current #2490 head 9d74bec0, which contains this PR at 9caf8fd5. It's a single matched pair, so it can catch a regression early, but it doesn't replace the run on the trimmed candidate.

Setup (Windows 11 build 26300; AMD Radeon RX 9070 XT, driver 32.0.32029.2010; Release): run.ps1 -Render -Translate -FakeUser -GpuMirror with the same scripted input, a 32 GiB job cap, X2W_D3D12_BUDGET=1 and 600 s. The baseline is main at the stack's merge base, 24cfd7c0. Each arm got its own copy of the same revision-17 shader cache, pre-translated offline, so neither depended on translation keeping up during the run. Inputs and logs stay local; these are aggregates only.

main 24cfd7c0 stack 9d74bec0
Stop 489.1 s, second-chance C++ exception raised in the D3D12 stand-in 551.0 s, second-chance C++ exception raised in a runtime library
Placed-resource 0x8007000e 0 (stopped earlier) 25, all after 489 s, right before the stop
Local budget at the last heartbeat 20.06 GB used / 14.19 GB budget 20.22 GB / 14.17 GB
Frames presented 5,422 at 200.8 s; 10,151 at 366.0 s 4,945 at 204.8 s; 9,586 at 370.2 s (the same ~30 fps rate after startup)
Translated compute Dispatch not in main 428 keys and 6.31 M Dispatches. 4,340 ran translated, all from 2 keys. Every other one was refused by name, mostly "no translation" (5.13 M) and "an entry value that is not a root constant" (0.90 M).
Device removal none none

Reading:

  • No new failure mode: the stack ran 62 s longer, and its out-of-memory results only appear past the point where the baseline had already stopped. That's the same late memory wall as in startup-runtime: guest-released committed textures are never freed, so local video memory exceeds the DXGI budget until the device is removed #2379, not a new failure from translated Dispatch.
  • Not a speedup: the stack was about 500 frames behind at 200 s, and caught up to the same frame rate after startup. With one pair per arm I can't tell whether that's variance, so I'm not reading it as a cost of the stack either.
  • Little title compute is translated: only 2 of 428 keys run translated, so the stack exercises very little of the title's compute work yet.

I'll repeat this matched pair on the trimmed head once #1974 and #1975 have landed.

AI-assisted; commands listed were executed locally.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@MasterDomino

Copy link
Copy Markdown
Collaborator

@NiiRoZz: the prerequisites have all landed. #1803 is on main as 4ce2931d, #1974 as 4c3fbfbd and #1975 as a8f2d250, and the slot 35 recorder fix #2636 is in as 1cd73d3a. This branch can now be trimmed to its own delta, per @R0Y00's 21:15 note.

What's still needed before it lands:

AI-assisted.

R0Y00 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Both prerequisites are now on main: #1974 at 4c3fbfbd and #1975 at a8f2d250. Thanks for the matched preview. The 4,340 translated calls from 2 of 428 keys are evidence for the mixed #2490 preview stack on that adapter; a single pair cannot isolate the later stop or establish a performance change. Please bring the compute-only diff and chasegrindy’s three controls onto current main, then repeat the matched run on that exact head. The first refusal, first allocation failure, last visible output and forwarded keys are enough for the public comparison. The future slot 61 path stays separate.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review of head 206749e4 (code and fixture tests only).

Result: no merge from this review. The merge stays with @MasterDomino or @R0Y00. This change claims to move startup forward, and the matched title run on the exact head is still pending. We have no title to run it here.

What I checked:

  • The diff against main is now only the compute delta (8 files, +496/-9). The snapshot copies of #1803, #1974 and #1975 are gone.
  • publish_compute_request now returns the key. Every refusal path returns 0, so a refused request leaves no key on the wrapper.
  • list_dispatch calls dispatch_translated first. The desktop decision of #1974 is untouched for every pipeline that is not a slot 67 placeholder.
  • list_compute_root now clears compute_srv_bound and sets compute_root_has_arguments, so a root change drops stale state.
  • The fixture covers dispatch, dispatch-none and dispatch-swapped (output descriptor without unordered access), so the refusal path has a control that must fail.

Still missing, as @MasterDomino listed above:

  • @chasegrindy's three slot 35 Dispatch controls (fenced nonzero-index readback with swapped descriptors, root change and back, ordinary view heap change).
  • A slot 86 desktop compute PSO case in startup_compute_dispatch_*, to show the translated path leaves it alone.
  • The matched executable run on this exact head.

Commands run on Linux in a worktree at this head:

  • git diff --check origin/main...HEAD (clean)
  • python3 tests/docs_links_check.py (19 files, 507 links)
  • python3 tests/bidi_controls_check.py (clean)
  • python3 tests/startup_compute_dispatch_check.py prints usage only: it needs the Windows-built consumer and dxc. I did not run the mutations.

The head is 3 commits behind main. No Win2025 run was done for this review.

AI-assisted; commands listed were executed locally.

@MasterDomino

Copy link
Copy Markdown
Collaborator

@chasegrindy, the recorder fix (#2636) is on main, and this branch is now trimmed to its own delta at 206749e4. Could you open your three slot-35 Dispatch controls as a test-only PR into NiiRoZz:startup/compute-dispatch-translated? That's how #1974's fixture went in (tedin7#1). Your commit and authorship stay intact, and @NiiRoZz only has to merge it. @NiiRoZz, does that work for you?

Once the controls are on this branch, I'll rebuild that exact head, rerun the slot-35 and refusal mutants on the RX 9070 XT, and repeat the matched title pair. For the comparison I'll report the first refusal, the first allocation failure, the last visible output and the forwarded keys, per @R0Y00.

AI-assisted.

@MasterDomino

Copy link
Copy Markdown
Collaborator

@NiiRoZz: @chasegrindy's slot 35 Dispatch controls are open as a test-only PR into this branch, NiiRoZz#1. I verified them on the RX 9070 XT and WARP (2/2, plus 275 neighbour tests passed), and all six slot 35 mutants are now caught, including the four that survived every earlier fixture. The details are in that thread.

What's left on this PR:

AI-assisted.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

@NiiRoZz @MasterDomino #2532 was squash-merged into main as de75613fb, and it carried this branch: its history includes "Merge pr2470 (origin/main) into pr2490". Comparing this head with current main (git merge-tree --write-tree origin/main <head>, then git diff origin/main <tree> --stat), the compute Dispatch path is already on main. What is left is about 34 lines of older comments and variants in d3d12_compute_dispatch.inl.

Before anything is closed: is the slot 35 Dispatch controls PR into this branch (NiiRoZz#1) still needed? If so, it could go as a small follow-up against main, and this PR could then be closed as superseded by #2532. If you would rather keep this one open for that, just say so here.

Thanks for the work on this stack.

AI-assisted; commands listed were executed locally.

@MasterDomino

Copy link
Copy Markdown
Collaborator

Thanks, @tedin7. I checked main (8016c393) myself: dispatch_translated, the COMPUTE-list NON_PIXEL_SHADER_RESOURCE transition, dispatch-sampled-compute and the x2w_d3d12_compute_census export all came in with #2532 (de75613f). So the code of this PR and of #2490 is on main, and closing both as superseded makes sense once @NiiRoZz confirms nothing in the leftover lines is still wanted.

Yes, NiiRoZz#1 is still needed. @R0Y00 made those three slot 35 Dispatch controls a condition for this code landing, and main doesn't have them (dispatch-table-offset isn't in the tree). On the RX 9070 XT and WARP they're what catch a dropped descriptor offset and a missing clear on a root or heap change; without them, those mutants pass every fixture. @chasegrindy, could you retarget it as a test-only PR against main? I'll re-verify it there.

@R0Y00, for the record: #2532 merged the translated Dispatch stack before three gates set for #2470/#2490 were met:

  • the slot 35 controls above;
  • the matched title run on the exact head;
  • your acceptance of the x2w_d3d12_compute_census export.

I'll run the matched title pair now on de75613f against its parent and post the comparison you asked for: the first refusal, the first allocation failure, the last visible output, and the forwarded keys. Let me know if you'd rather handle the census export differently now that it's on main.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

@MasterDomino Cannot run Win2025 tests on 206749e4 yet because this branch has merge conflicts with main; please rebase and tag @tedin7 again.

@MasterDomino

Copy link
Copy Markdown
Collaborator

@R0Y00, here's the matched run you asked for, on the code that actually landed: #2532 (de75613f, which carried this PR and #2490) against its parent 4f7dd6ce.

Setup (Windows 11 build 26300; AMD Radeon RX 9070 XT, driver 32.0.32029.2010; Release):

  • run.ps1 -Render -Translate -FakeUser -GpuMirror, with the same scripted input, a 32 GiB job cap, X2W_D3D12_BUDGET=1 and 600 s.
  • Shader cache: startup: compute input named by a resource heap record a root constant indexes #2532 also changes gfx2hlsl.py at the same cache revision (17). So each arm got the same rekeyed requests, translated offline by its own translator, and its own copy of the cache.
  • Inputs and logs stay local; these are aggregates only.
parent 4f7dd6ce #2532 de75613f
First Dispatch refusal ~56 s, "requires a desktop compute pipeline and root" (native slot 14) ~63 s, "no translation"
First allocation failure none before the stop ~489 s, a placed texture create returning 0x8007000e (8 in total, all in the final seconds)
Last visible output 13,209 frames presented at 481.9 s 12,210 frames at 489.3 s
Stop 490.9 s, second-chance C++ exception raised in the D3D12 stand-in 497.1 s, second-chance access violation in a runtime library under title frames
Forwarded keys none (translated Dispatch not present) 2 of 435 keys, 3,456 of 4.85 M Dispatches translated. The rest were refused by name, mostly "no translation" (3.82 M) and "an entry value that is not a root constant" (0.74 M).

Frames presented at matched times:

~63 s ~100 s ~200 s ~300 s ~400 s ~480 s
parent 1,233 2,212 5,213 8,213 11,018 13,209
#2532 912 1,841 4,841 7,841 10,314 11,968

Reading:

Still open: the slot 35 Dispatch controls (NiiRoZz#1, to be retargeted against main) and your call on the x2w_d3d12_compute_census export.

AI-assisted; commands listed were executed locally.

@MasterDomino

Copy link
Copy Markdown
Collaborator

Follow-up on the frame-rate difference: two places in main's d3d12_compute_dispatch.inl fit it. I haven't profiled either yet.

  • The lock on every call: dispatch_translated takes draw_lock exclusively on every Dispatch with a slot 67 placeholder bound, before any refusal check (:148). That's about 10 k calls per second here, almost all of them refused, and each one serializes against the draw path's use of the same lock.
  • Manifest retries: for a key with no manifest, load_compute_translation retries reading the manifest file once per second, still under that exclusive lock (:58-66, :160). With about 433 untranslated keys, that's up to ~433 file reads per second while draw_lock is held.

Two ways to confirm it: a pair with the untranslated keys' retries backed off (or the lock taken only once a key is ready), or a short CPU profile around a run. I can do either on the RX 9070 XT if that helps. @NiiRoZz, since this is your code now on main, how would you like to approach it?

AI-assisted.

@R0Y00

R0Y00 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thanks for the matched run on landed #2532. Please start with a short CPU profile on the same warmed build and fixed input. Capture the time in the Dispatch refusal path, waiting for the shared graphics/compute lock, and manifest stat/open work separately. If the profile implicates manifest polling, try a second matched run changing only the retry interval. Record refused and forwarded calls, cache readiness, and presents at matching times. A source-built retry fixture should still show that a manifest published after an initial miss is picked up. Keep the census export as a diagnostic while collecting this evidence. The current counts establish that two keys forwarded and that the two runs ended at similar times; the slowdown's cause is still open.

@MasterDomino

Copy link
Copy Markdown
Collaborator

@R0Y00 @NiiRoZz, here's the profile of landed #2532 (de75613f) and the retry-interval pair.

Method. A kernel sampling profile needs elevation here, so I used a local-only instrumented build of de75613f instead; none of it is meant for commit. It adds QPC totals in dispatch_translated, logged with the census:

  • time spent in refused calls and in forwarded calls;
  • the wait to acquire draw_lock;
  • how long draw_lock is held;
  • the time inside load_compute_translation (the manifest stat/open/read), with a count.

Both runs used the same warmed cache snapshot, the same scripted input, the same 32 GiB cap with X2W_D3D12_BUDGET=1, and 600 s, on Windows 11 build 26300 with an AMD Radeon RX 9070 XT (driver 32.0.32029.2010), in Release. Only the retry interval differs: retry_manifest_at = now + 1000 in A and + 10000 in B. Inputs and logs stay local; these are aggregates only.

totals over the run, summed across threads A: retry 1 s (as on main) B: retry 10 s
Refused calls, time in the path 5.02 M, 98.3 s 5.91 M, 46.2 s
Forwarded calls, time 3,586, 0.11 s 4,157, 0.10 s
Manifest loads, time 45,971, 29.6 s (about 0.64 ms each) 4,973, 3.4 s
draw_lock held by Dispatch 30.8 s 4.7 s
Waiting to acquire draw_lock 66.4 s 40.7 s
Forwarded keys, out of keys seen 2 of 427 2 of 430
Cache readiness same warmed snapshot same warmed snapshot
Stop 460.8 s, access violation in the title 491.8 s, access violation in the title

Frames presented at matching times:

~60 s ~100 s ~200 s ~300 s ~400 s ~450 s
A 1,394 2,594 5,594 8,431 10,498 11,591
B 968 2,015 5,015 8,015 10,749 11,979

Reading:

  • Manifest polling is the main cost. In A, 96% of the time a Dispatch holds the exclusive draw_lock is failed manifest reads for untranslated keys. A 10 s retry cuts those reads 9×, cuts lock hold time 6.5×, and halves the time spent in the refused path.
  • Busy section: from 300 s to 450 s, B presents 3,964 frames against A's 3,160 (+25%), the part where the slowdown against the parent was largest.
  • Startup: B was lower before 300 s. With one pair I can't separate that from startup variance, so I'm only reading the late section.
  • A second cost remains. B still waits 40.7 s for draw_lock while holding it for only 4.7 s itself. So most of that wait is Dispatch blocking behind the draw path's own use of the lock. Taking draw_lock exclusively on every Dispatch, mostly to be refused, contends with draws independently of the polling.
  • The retry fixture: a longer interval delays picking up a manifest published after a miss; it doesn't drop it. I haven't run the "published after an initial miss" fixture with the 10 s interval yet. A fix that keeps the interval short for fixtures and backs off per key in the title (for example 1 s, then growing) would keep that guarantee.

Possible directions (for @NiiRoZz):

  • back off the manifest retry per key, or check readiness outside draw_lock;
  • take the exclusive lock only for a key that's ready, so a refusal for a missing translation is decided from a shared or lock-free read.

I can run the matched pair again on a fix.

AI-assisted; commands listed were executed locally.

@R0Y00

R0Y00 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

The measurements support a focused per-key retry change. The 1 s run spent 29.6 of its 30.8 seconds holding the Dispatch lock inside manifest loads. The 10 s run cut that to 3.4 of 4.7 seconds, with the same number of forwarded keys. The startup presentation counts still vary, so please keep that separate. @NiiRoZz, start with a bounded per-key backoff after repeated misses, keeping the first retry prompt. Leave the lock redesign as a separate change. Extend the existing startup_compute_live_retry fixture so a manifest published after a miss becomes usable on the same pipeline, and use a controllable clock or an isolated schedule test to check both reduced polling and reset after success. MasterDomino can then rerun the matched pair.

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.

6 participants