d3d12-docs: record LEONIDA_CONSTANTS_ONCE measurements in findings.md #2888
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2888"
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 lixonik on 2026-12-01T15:31:09Z.
Claimed in the coordination issue as:
D3D12-CONSTANTS-ONCE-DOCS(https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7315907475)What and why
Follow-up requested when closing #2850 (whose code landed in
357c71023):Table constant buffers filled once per list (2026-12-01)measurements from #2850 (RTX 3080 10 GB) and the independent RTX 5070 12 GB (621.40)LEONIDA_AB=20,LEONIDA_CONSTANTS_ONCEcheck tod3d12/docs/findings.md.d3d12/docs/switches.mdviapython -I tools/d3d12_switches.py --out d3d12/docs/switches.mdso theF("named in findings.md") column onLEONIDA_CONSTANTS_ONCEupdates toyes(while theLEONIDA_CONSTANTS_ONCErow itself was already present onmain).Tested
python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: passedpython -m unittest discover -s tests -p "test_docs_*.py" -v: 57 passed, 0 failedpython -I scripts/check_no_game_data.py: cleanGPUs tested: n/a (documentation-only; references measured results from #2850 on RTX 3080 10 GB driver 32.0.16.2140 and RTX 5070 12 GB driver 621.40 / Windows 10 22H2)
AI-assisted: Antigravity (plus separate read-only reviewer subagent)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T17:40:10Z.
Review: COMMENTED
Mechanism and figures check out:
LEONIDA_CONSTANTS_ONCEis thetoggled!athost.rs:9636, reuse is keyed on(src, len)and re-points viaadd_slot(host.rs:9629-9664), invalidation istitle_written(host.rs:3624-3631), andFillTo::Slotsreally does re-point every slot at one place (card_steps.rs:645-647,:1185-1189) — bytes read once, no barrier change claimed or made. The 3080/5070 deltas match #2850 and its 5070 comment, and the merged tree'sswitches.mdregenerates clean.One arithmetic nit: 3,327 / 11,578 = 28.7 %, not 28.8 %. If 28.8 % is the median of per-frame ratios, say so; and note 1.6 MB is 27.6 % of 5.8 MB, so the parenthetical is a count share, not a byte share — as written it invites the wrong comparison.
Four small completeness fixes for a measurement record:
−0.85its unit;card_steps −0.16that the 5070 paragraph includes.Minor:
−0.77idle and30.5busy are per-arm means, not paired deltas — worth labelling so they aren't read as a 13-pair result.CI: both red checks are the five Python tests main fixed in
9b7674d64at 15:54Z, after this run started; they pass on the merged tree, so a re-run should clear them. Merge is clean, andfindings.md's other open editors (#2847, #2743) do not share a hunk with this append.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T20:51:56Z.
@KelboLive Thanks for checking every number against #2850! Addressed all items in
d8de91272and mergedorigin/mainso CI picks up the Python test fixes:3,327 / 11,578to28.7 % of fills; 1.6 MBso the count share is exact and clearly distinguished from the byte share.on minus off), themsunit on-0.85 ms, the 3080 OS (Windows 11), and the 3080card_stepsdelta (-0.16 ms).7.21 ms off to 6.44 ms on, -0.77 ms) and card busy (30.49 ms off vs 30.48 ms on) numbers explicitly as per-arm means (14 phases each).4 of 9 pairs valid, 5 dropped for draw jumps).Re-verified
tools/d3d12_switches.py --check d3d12/docs/switches.md,test_d3d12_switches.py(19/19),test_docs_*.py(57/57), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-02T05:32:35Z.
VERIFY-2888 — Linux, Fedora 45, no GPU device, no game files, no title
Verdict: PASS. Records a
LEONIDA_CONSTANTS_ONCEmeasurement ind3d12/docs/findings.mdand marks the switch "named in findings" (F = yes) in the generatedd3d12/docs/switches.md. Every checkable claim matches the code — including the code's own comment athost.rs:9832, which records the same measurement with the same figures — and the hand-edit toswitches.mdis byte-identical to whattools/d3d12_switches.pyregenerates for that row. The measurements themselves are not reproducible here.Head
d8de9127, base currentmain(8422def7), merge base1e3e316c, 2 files, +20/−1:d3d12/docs/findings.md(+19),d3d12/docs/switches.md(+1/−1, one cell).1. What it changes
d3d12/docs/findings.md: a new## Table constant buffers filled once per list (2026-12-01)section describing the per-draw constant-buffer-view fills (11,578 fills/frame, 3,327 first of their bytes), whatLEONIDA_CONSTANTS_ONCEdoes about them, the measured gains on an RTX 3080 (driver 32.0.16.2140) and an independent RTX 5070 (driver 621.40) check.d3d12/docs/switches.md: theLEONIDA_CONSTANTS_ONCErow's F column (named in findings.md) changes from blank toyes.2. The claims it makes, and which ones I checked
LEONIDA_CONSTANTS_ONCE, on by default,0turns it off — checked.host.rs:9832"WithLEONIDA_CONSTANTS_ONCE(on by default;0: one fill each, as before)";switches.md"on,0turns it off".HostList::constants— checked.host.rs:3753fieldconstants: HashMap<...>, doc "Table constant buffers [HostList::constants] filled since the list"; theconstants()fn athost.rs:9834.FillTo::Slots— checked.host/card_steps.rs:190variantSlots(Vec<(usize, u32)>);fill_tos()maps each slot to aTo::Slot, i.e. the card re-points every slot of a fill it takes — consistent with the doc.LEONIDA_CARD_STEPS=2— checked.host/card_steps.rs:79reads it;:360"LEONIDA_CARD_STEPS=2 does it on the card".constants_lineframe-meter count — checked.host.rs:5717fn constants_line, "For the frame-rate line"; it prints "table constant buffers filled per frame: {:.0} ({:.0} KB), {:.0} of them the first of their bytes in their list ({:.1} %, {:.0} KB)" — matching the doc's fills/KB/first/%/KB format.copies_fills_ms,steps_ms,card_steps_ms— checked. These are the millisecond form of theSPLIT_NAMESentriescopies_fills_ns,steps_ns,card_steps_ns(host.rs:11139,:11132,:11141), which the frame-rate A/B line prints. Consistent.-NoFrameGen— checked.d3d12/scripts/play-nvidia.ps1:76[switch]$NoFrameGen.host.rs:9832records the same measurement: "Standing in the world, 71 % of these fills repeated bytes already filled in their list (11,600 a frame, 5.8 MB; 3,300 and 1.6 MB the first of theirs; RTX 3080, 2026-12-01). Switched every 20 s in one run (13 pairs): the lists' steps on the submitting thread -0.99 ms a frame, its copies and fills -0.85, the card idle behind it -0.77, the frame's median -0.39 (+-0.14); the card's work the same." The doc gives the same figures with more precision (11,578/3,327 vs the code's rounded 11,600/3,300; 28.7 % first vs 100−71 = 29 %). No contradiction.switches.mdF cell — checked.tools/d3d12_switches.pysets F = yes when findings.md names the switch; regenerating the page from the PR's sources produces the exact committedLEONIDA_CONSTANTS_ONCErow (F = yes, sameNamed inand same words). The hand-edit matches the generator.3. What the tests do here
python3 -I -m unittest discover -s tests -p "test_docs_*.py"— 57 tests, all pass (43.1 s).python3 -I scripts/check_no_game_data.py d3d12/docs/findings.md d3d12/docs/switches.md— exit 0.python3 -I scripts/red_green.py 2888 --no-cargo— "red not constructible: the pull request changes no test" (expected for a docs-only change).git merge-tree --write-tree origin/main pr2888— merges cleanly.4. Anything wrong in the text
## ... (2026-12-01)heading,**bold**lead-ins and 4-space code/table blocks match findings.md's conventions; the section is appended before the end of the file (no table of contents to update); the repeated-line docs test passes (no duplicated lines).main, so its committedswitches.mdstill namesLEONIDA_RENDER_SCALE_MINinleonida-loader/hooks.rswhile currentmain(after a later regeneration) names it inleonida-gpu/host/menu.rs. This does not affect the PR's own edit and merges cleanly (merge-treeexit 0); it only means the branch predates that regeneration.5. What I did not check
host.rs:9832) rather than re-measuring.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:01:05Z.
Verified on Linux: head
d8de91272merged into currentmain45dc41f95(clean merge;findings.mdandswitches.mdauto-merged). Documentation only. Ready.Checked the arithmetic in the new section: 3,327 / 11,578 = 28.7 % of fills, as written. The second run's whole-frame median (-0.175 +- 0.411 ms) is correctly called "no clear difference" rather than a gain; the per-phase deltas on the submitting thread are what both runs agree on.
LEONIDA_CONSTANTS_ONCEis still on by default inHostList::constants, matching the text. CI on the head is green.No code, so no red/green. This agrees with @imShangLi's PASS on the same head; nothing has been pushed since.
Verdict: ready.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code