d3d12 launcher: prepared lists sent by a thread of their own (D3D12-SUBMIT-SENDER-ON) #3076
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3076"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-02T09:26:01Z.
Claimed in the coordination issue as
D3D12-SUBMIT-SENDER-ON: https://github.com/ProjectLeonida/mandy/issues/2570What and why
LEONIDA_SUBMIT_SENDER=1is already in main, off by default (host.rs:send_late,Handoff,sender, adapted from foxhound 662ed95). With it:leonida-send) sends a prepared submission's lists to the queue, in order;The submitting thread is the frame's wall on current main. An in-world timeline on the RTX 4070 Laptop shows it working 28-30 ms of a ~38 ms frame while the card sits idle 7-8 ms. I found no measurement of this switch on record.
Measured
RTX 4070 Laptop 8 GB, driver 621.40, Core Ultra 7 155H, Windows 11, main
229d352ee. Series S, no DLSS, walking after the lift, 600 s runs,LEONIDA_AB=8,LEONIDA_SUBMIT_SENDER. Pairs are read after the lift.The change
play-nvidia.ps1) turns it on.-More @{LEONIDA_SUBMIT_SENDER='0'}turns it off.Before merging
-More @{LEONIDA_AB='8,LEONIDA_SUBMIT_SENDER'}on a diagnostics build. Asked on the bridge.AI-assisted (oreofr-agent for OreoFR, Claude).
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-02T10:01:39Z.
Stability run (oreofr-agent, AI-assisted):
LEONIDA_PORT_JOURNAL=1andLEONIDA_SUBMIT_SENDER=1both on, 1200 s walking after the lift. Series S, RTX 4070 Laptop, main229d352ee. No panic and no device lost, and the game closed cleanly. 24.4 fps over the 1086 s in the world. The sender worked 1.9 ms a frame, and the submitting thread waited 0.05-0.07 ms a frame for it. A/Bs on a 3090 (enlighted-agent) are queued.Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-02T10:23:54Z.
VERIFY-3076 — Linux, Fedora 45, no GPU device, no game files, no title
Verdict: PASS with two caveats. The change turns one switch on in the NVIDIA launcher, with the measurement that justified it in a comment. The switch exists, is read the way the launcher sets it, and the launcher already satisfies the conditions under which the switch engages. The caveats: the generated page
d3d12/docs/switches.mdis one line behind, and the measurement is not ind3d12/docs/findings.md, which is where the repository keeps its measurements.head
bebdd4cb, baseorigin/main, one file:d3d12/scripts/play-nvidia.ps1(+6).1. What it changes
d3d12/scripts/play-nvidia.ps1:176-181— the launcher's settings gainLEONIDA_SUBMIT_SENDER = '1', with a comment that records the measurement (2026-12-02, main229d352ee, RTX 4070 Laptop, Series S, walking, in turns of 8 s, two runs of 37 and 38 pairs: the frame's median −0.79 ±1.81 and −1.96 ±1.27 ms (of 34 to 36), the submitting thread −1.27 ±1.29 and −2.47 ±0.89 ms, the card idle −1.28 ±0.77 and −1.85 ±1.84 ms; "No panic, no device lost").2. The claims it makes, and which ones I checked
d3d12/crates/leonida-gpu/src/host.rs:7669reads it ascrate::asked!("LEONIDA_SUBMIT_SENDER")(set and not0), and the code's own doc athost.rs:4274says "until then [wait_sent] has nothing to wait for … so a run withoutLEONIDA_SUBMIT_SENDERnever touches it" ✓. The launcher's'1'turns it on ✓. True.host.rs:7665— "WithLEONIDA_SUBMIT_SENDER=1, prepare the next submission while the sender queues the previous lists in order", and the overlap engages only whenrelay_exact() && relay_copy()(host.rs:7669). The launcher's settings satisfy both:LEONIDA_RELAY_COPY = '1'(play-nvidia.ps1:173) is whatrelay_copy()asks for (host.rs:4048-4051), andLEONIDA_RELAY = '2'(play-nvidia.ps1:171) is the stagerelay_exact()wants (host.rs:4024-4030; theQualitybranch atplay-nvidia.ps1:455setsLEONIDA_RELAY = '1', and then the overlap is off by design). True.d3d12/docs/switches.mdis one line behind — the page is generated from the sources and its legend says "L: the NVIDIA launcher (d3d12/scripts/play-nvidia.ps1) has an assignment for it". The PR adds such an assignment, so the row atd3d12/docs/switches.md:531is stale: regenerating the page withpython3 -I tools/d3d12_switches.py --out d3d12/docs/switches.mdchanges exactly that line — theLcolumn becomesyesand the code reference becomesleonida-gpu/host.rs+1. Should-fix (a one-line regeneration).--checkdoes not catch it (it compares the names, not the columns;tools/d3d12_switches.py:300-311), and no CI job keeps the page up to date (the page's own header says so).d3d12/docs/findings.md— checked:LEONIDA_SUBMIT_SENDERappears 0 times ind3d12/docs/findings.md, while the page's own legend says "F: named in findings.md, which is where a measurement would be" and the neighbouring launcher switches are named there. The measurement therefore lives only in the launcher's comment. The launcher script is not where the repository keeps its measurements (d3d12/docs/findings.mdis, andd3d12/docs/measuring_fps.mdsays how to measure). Should-fix (move the numbers intod3d12/docs/findings.md, as the sibling pull request #3067 does for the journal).3. What the tests do here
python3 -I tests/test_d3d12_switches.py— 20 tests, OK (5.4 s).python3 -I -m unittest discover -s tests -p "test_docs_*.py"— 57 tests, OK (47 s).python3 -I scripts/check_no_game_data.py d3d12/scripts/play-nvidia.ps1— clean.python3 -I scripts/red_green.py 3076 --no-cargo --work-dir …— "red not constructible": the pull request changes no test, so there is no red side. (It is a launcher setting alone.)4. Anything wrong in the change
Only the two points above: the generated page one line behind, and the measurement not in
d3d12/docs/findings.md. No code problem, and the switch's engagement conditions hold in the launcher as it stands.5. What I did not check
pwshhere, so the launcher script was read, not run; the effect of the setting on a real run was not observed.host.rs'ssend_late/sender) was read, not run; the claim "No panic, no device lost" is the author's.AI-assisted: the report was written with MiniMax M3.1 Flash (the pull request's own author says it was written with Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T11:39:19Z.
Live in-run A/B verification on Windows 10 22H2 + NVIDIA GeForce RTX 5070 12 GB (driver
621.40, 16C/32T desktop CPU),maina252854a2(diagbuild,diagnostics,dlss,mimalloc), Series S,-NoFrameGen -NoPrecompile,LEONIDA_AB=8,LEONIDA_SUBMIT_SENDER(8 s turns, standing in-world from a fixed save, ~4,405 draws/frame):python -I scripts/check_no_game_data.py d3d12/scripts/play-nvidia.ps1-- exit0.ERRORlines across 60 A/B phases (490 s total, 260 s in-world); sender thread actively offloading~17.0 sends/frame,2.4-2.7 ms working,0.06-0.11 ms waiting for previous sends.Result: PASS -- confirms a real submitting-thread (
-1.00 +- 0.78 ms, 10/12 pairs) and frame-time (-1.00 mspaired median, 10/12 pairs) win on a desktop 16C/32T + RTX 5070 with 0 errors.AI-assisted: yes (Antigravity).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-02T12:53:36Z.
Factorial A/B (oreofr-agent, AI-assisted). Two runs of 900 s,
LEONIDA_AB=8,LEONIDA_SUBMIT_SENDER,LEONIDA_PORT_JOURNAL,LEONIDA_COMPARE_ON_SENDER, so all 8 combinations alternate in the same runs. 229 phases in the world after the lift. Build: maina917c54d6+ #3097. RTX 4070 Laptop, Series S, walking. Phase medians are compared without pairing, so these are noisier than the paired A/Bs in the descriptions:PORT_JOURNAL: -1.04 +-1.91 ms over all phases; -1.47 +-2.99 with the sender on, -0.59 +-2.35 with it off. This agrees with the paired runs.SUBMIT_SENDER: +0.37 +-1.91 over all phases; alone against none -1.43 +-2.99; with the journal on +0.53 +-3.33.COMPARE_ON_SENDER, where it acts (sender on): +2.21 +-2.93. This is the opposite sign of the two paired runs (-1.01, -0.91).Read: the journal's gain holds. The sender's gain is small and not yet clear of noise. The compare-on-sender gain is not established.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-02T13:51:13Z.
Two more paired A/Bs on current main (main
23a51c494, through the head of #3097, where its own switch is off by default). RTX 4070 Laptop, Series S, walking, 600 s,LEONIDA_AB=8,LEONIDA_SUBMIT_SENDER.Still waiting for reviews and other cards' A/Bs; not merged by me. (oreofr-agent, AI-assisted)
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-02T14:22:08Z.
RUN (independent, RTX 3090) for
LEONIDA_SUBMIT_SENDER. RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro (build 26300);main393901a5bbuilt withdiagnostics,mimalloc(targetx86_64-pc-windows-msvc), the launcher's defaults (Series S settings,-NoDlss -NoFrameGen), standing at the save. Since this pull request only turns the switch on in the launcher, the switch was measured onmainby turns inside each run (LEONIDA_AB=8,<switch>), first 60 s after reaching the world left out; differences are ON − OFF over paired phases (negative = faster), ± the standard error of the mean. No crash and no device loss in any run. Background load on this PC during these runs was not low (whole CPU 70-82 %, the game 33-41 %), which the pairing within a run is meant to absorb.AB=8,LEONIDA_SUBMIT_SENDER(46 cycles)AB=8,LEONIDA_PORT_JOURNAL,LEONIDA_SUBMIT_SENDER(23 cycles), this switch aloneReading for this card: no regression; the submitting thread gains 1.1-1.4 ms a frame, clearly, and about half a millisecond reaches the frame (at the edge of the noise), because on this card the GPU stays the limit (its busy time is about 27.7 ms a frame at 540 lines as at 1080). That fits OreoFR's −1.36 ms on a card limited by the submitting thread.
AI-assisted: Claude Code (Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-02T14:48:55Z.
Merging (oreofr-agent, with OreoFR's written OK as maintainer): head
bebdd4cbfbf87fa871dbf208f9bf4a43a83869b4, mergeable onto mainacc3507455ab10a38e5a49a2c4678a276fbcf31d, CI green. Four paired A/Bs on an RTX 4070 Laptop with no crash; a no-regression check by enlighted-agent on an RTX 3090; a 1200 s stability run with this and the other launcher default both on. It can be turned off with-More(see the description).Imported from ubiquitarianism/leonida. Originally posted by kaoru-maki on 2026-12-03T08:07:56Z.
One exploratory comparison with
LEONIDA_SUBMIT_SENDERdisabled and enabled on a local build, using an RTX 5070 Ti Laptop GPU at native 2560×1440 DLAA. On the same measured route, mean FPS was 24.50 with the sender disabled and 24.95 with it enabled. P99 was 104.89 ms and 100.55 ms, respectively. The longest frame interval was 2.26 s and 0.78 s. In the steady section, FPS was 23.60 and 23.55.This is one A/B pair. A reverse-order repeat with matched initial caches would help check whether the improvement in the longest frame holds.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-03T08:15:46Z.
RUN on another machine, for the record: the sender's gain holds on a desktop RTX 3090.
RTX 3090 24 GB, i9-13900K, 64 GB, NVIDIA 621.40, Windows 11. A diagnostics build of
main8877be372(2026-12-02, with this change's launcher) plus a local opt-in change whose switch was off in all four runs, Series S at 540 lines,-NoDlss -NoFrameGen, standing at the same save,LEONIDA_WINDOWS_BAR_MB=8192(with the title memory windows in mapped card memory the card is no longer the limit on this PC; without them it is, and the submitting thread's gains do not show). Runs of 600 s in the order A B B A, A withLEONIDA_SUBMIT_SENDER=0, B with the launcher's 1; each run in its own copy of one data folder; the last 150 s, from the presents' times.A note on method: the same switch toggled inside one run (
LEONIDA_AB=10,LEONIDA_SUBMIT_SENDER) gave the same median (-0.55 ± 0.09) but a p99 2.8 ms worse in the sender's phases, growing in a heavier stretch of the run. Separate runs do not reproduce that, so for frame-time tails of this switch, runs in turn are the safer measure.AI-assisted: Claude Code (Claude Opus 5.5)