Commit Graph

84 Commits

Author SHA1 Message Date
51fbf718ba The write-combined part of a mixed copy is left out of the copy-back by default (LEONIDA_WC_SUBRANGE_NO_BACK on): the card and the submitting thread 1 ms a frame lighter each
- shadow.rs: wc_subrange_no_back (f85d1790a, by hardly-relevant) is on
  unless LEONIDA_WC_SUBRANGE_NO_BACK=0. The copy the compares behind
  submissions go over most, 147 MB of the 32-bit graphics heap four times a
  frame, spans its 47 MB write-combined part (0x2404) and its 100 MB cached
  one; the whole-copy rule (LEONIDA_WC_NO_BACK) never took it.
- findings.md: the measurements.

Standing at the waterside save, Series X, 1,080 to 1,440 lines, no
generated frames, by turns of 4 s (run d317, 55 phases): the card busy
-0.99 +-0.40 ms a frame, the submitting thread -0.99 +-0.40, the frame's
median -0.68 +-0.61, means -0.48 +-0.68. Recorded tour (d318, 581 frames):
49 frames with one-frame cells, 79 cells, all where the camera swings, as in
the tours before; nothing torn.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the runs
above; cargo check with diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:23:47 -05:00
ecaa291d5b Title memory windows' line in card memory the CPU maps can be set (LEONIDA_WINDOWS_BAR_LINE, 80 by default); notes on windows up to 6 GB and the paired form for the heaviest passes
- shadow.rs: window_mapped_for stopped making windows in card memory the
  CPU maps at 80 hundredths of the card's budget, a fixed line. On this PC,
  where other programs held 4.4 GB of the 16 GB card, the line kept 1.7 GB of
  windows in the PC's memory with a 6 GB cap (run d314).
  LEONIDA_WINDOWS_BAR_LINE sets it (50 to 97), to measure what those windows
  cost read over the bus. Nothing changes without it.
- findings.md: windows up to 6 GB (d314: 39 more windows there, the line
  stopped the rest; PCIe 3.9 GB/s received and 5.1 sent at the median), and
  the paired form for 16 of the heaviest single compute passes (d312 against
  d316: no clear gain, not taken).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the runs
named; cargo check with and without diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:22:40 -05:00
955e7d9cf2 Indirect batches stay open past programs that only read through views picked from the heap, by default: 928 clamp passes a frame become about 180, the card 3.7 ms a frame lighter
- draw.rs: LEONIDA_BATCH_HEAP_READS is on unless set to 0. stores_bound
  already says no of every store through a picked view, so the extra rule
  only kept batches from staying open past programs that read through
  picked views: the 934 CS_RaytracingResolve dispatches a frame (and the
  meshlet culling passes, which store their records through views their
  binds declare and now end a batch for those records alone).
- findings.md: the measurements; switches.md regenerated (with the
  switches of the main commits merged before).

Standing at the waterside save, Series X, 1,080 to 1,440 lines, no
generated frames: 175 to 186 batch passes a frame against 928 (run d311
against d275, LEONIDA_BATCH_WHY), 8 of them ended for stores not declared
(793 before). By turns of 4 s (run d310, 53 phases): the frame's median
-2.11 +-0.69 ms, means -1.86 +-0.86, the card busy -3.67 +-0.43, the
submitting thread +0.48 +-0.73. Timing run (d312): the card's timed work
60.5 ms a frame against 63.2. Recorded tour (d313, 520 frames): 37 frames
with one-frame cells, 67 cells, all in fast turns, at the low end of the
tours before; terrain, foliage, the house and the player drawn.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the runs
above; the batched clamp's WARP tests; cargo check with and without
diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:49:17 -05:00
e12f7f9f9a Notes: NVIDIA's float forms timed, the light stand-in's near-surface switch, the clamp passes' wait; switch list
findings.md: LEONIDA_HOST_FLOAT in timing runs (d294 51.82, d306 51.81 ms of the card's timed work a frame; the
first run after compiling its pipelines, d303, 54.51, the driver's background compiles), left on; LEONIDA_AMBIENT_NEAR
not shown to be needed here (runs d304, d305), left off; the clamp pass waiting only for its record buffers (run
d302) no quicker. switches.md regenerated (LEONIDA_HOST_FLOAT, LEONIDA_AMBIENT_NEAR).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs d302 to d306 (Series X profile, 1440p
output, dynamic resolution from 1080 lines, frame generation off).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 07:51:34 -05:00
10d8223336 Notes: join parts 8 against 4, and legacy multiplies as plain products, measured
findings.md: 8 parts of submissions joined against 4 by turns (run d296, 112 phases; ImTaneax/VIctory-RTX3050-4gb
2b3030f joins at most 4 there): the frame the same, the submitting thread 3.18 +-0.32 ms less with 8, so 8 stays.
LEONIDA_LEGACY_PLAIN=1 in timing runs with every pipeline from the library (d294, d297): 51.82 -> 51.25 ms of the
card's timed work, within what two runs of one build differ; left off.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs d294, d296, d297 (Series X profile, 1440p
output, dynamic resolution from 1080 lines, frame generation off).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 03:18:03 -05:00
adb8ea4741 Notes: the precompile's notes per executable name, measured
findings.md: library loads as each name (43 s, then 16 s, as leonida_sm.exe; 28 s as leonida.exe for the
same 400), the storm of run d291 with notes by translation alone, and run d293 after the change (4,875
loaded through the library in 61 s; the world at 74 to 110 ms a frame, none loading after two and a half
minutes).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs d291 and d293 (Series X profile,
1440p output, dynamic resolution from 1080 lines, frame generation off).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 02:11:13 -05:00
aefb250844 Merge remote-tracking branch 'origin/main' into push/main-1130 2026-12-01 01:28:25 -05:00
b024e59403 Notes: why the game compiled the precompile's pipelines again, and what was done; the switch list regenerated
findings.md, under the static samplers: the two causes (the precompile's processes had no sampler
places; the driver's cache on disk does not keep what the precompile compiles, about 30 % lost), the
measurements (the card test, 116 of 400 compiled again, run d287's 1,700 in the world, run d289's 3,540
loaded and 74 made after the store), and that forced stops of test runs write neither cache.
switches.md: LEONIDA_WARM_LIBRARY, LEONIDA_NO_WATCHDOG's default, and main's
LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs d287, d288, d289 (Series X
profile, 1440p output, frame generation on).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 01:28:22 -05:00
640b0d0df8 Merge pull request #2802 from bobcatchris/perf/d3d12-gpu-texture-digest-aes
D3D12-GPU-TEXTURE-DIGEST-AES: hash a texture's memory with AES rounds (23.6 -> 108-139 GB/s in cache, 2.9x from memory)
2026-12-01 06:34:39 +01:00
9d231d373c Lists' scratch in the card's memory with the budget-sized pool measured: the frame 1.87 ms shorter here
By turns of 4 s standing (run d282, RTX 4060 Ti 16 GB, 96 phases): card scratch on against off with the spare chunks
kept to the card's budget, the frame's median -1.87 +-0.30 ms, means -1.61 +-0.40, the card -1.94 +-0.24 (with the
old pool in d281: -1.15 +-0.36, -0.84 +-0.38, -1.72 +-0.30). Chunks made in the card's memory 19.5 a second against
48, residency waited for 1.0 ms a frame against 3.7; the churn guard never tripped. The switch's notes and the
findings say so.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs d281 and d282.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:54:27 -05:00
a69ec496d1 Findings: the title told at its first signal, and three frames ahead, do nothing here
Both after ImTaneax's VIctory-RTX3050-4gb, by turns of 4 s in one run standing (d280, 112 phases, RTX 4060 Ti):
LEONIDA_RELAY_EACH the frame's median +0.73 +-0.46 ms, LEONIDA_SUBMIT_FRAMES=3 against 1 +0.60 +-0.46. The card is
the wall here, so the title learning sooner or running further ahead wins nothing. Both stay off.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: run d280.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:20:34 -05:00
caceb1727c The amplification stage measured slower in the game: LEONIDA_MESH_AMPLIFY stays off, findings for it and the driver cache
By turns of 4 s standing (run d279, RTX 4060 Ti) the stage made the frame's median +4.42 +-0.40 ms and the card
+7.64 +-0.68 ms a frame. The batches' clamp passes it was to take away open for the title's indirect dispatches and
vertex draws; the mesh executions only read from batches those had opened (860 opened a frame with the stage, 871
without), so no pass went and each mesh draw paid for the stage. The switch stays, off, with nothing of it made
without it. Also written down: the joined parts measured again (8 against 1, 16 against 8), and the full driver cache
file that made every start compile some 600 pipelines in the game.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs d273 to d279 (A/B by turns, recorded tours).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 21:58:22 -05:00
d87ada3917 Mesh executions of one record can be launched by an amplification stage that reads the record itself (LEONIDA_MESH_AMPLIFY, off)
The title's mesh draws are indirect executions of one record each, which its culling passes write:
8,600 a frame standing at the waterside, clamped by 955 batch passes (run d275). A pass is a compute
dispatch of ours between the draws and a wait for it. With the switch, and the stage's code in the file
LEONIDA_MESH_AMPLIFY_DXIL names (DXC's as_6_6 of indirect/amplify.hlsl; the translator's own DXIL writer
does not make it yet), mesh pipelines are made a second time with the stage in front, reading the record
through a root view appended to their root signature, and such executions are DispatchMesh(1, 1, 1) of
that form: X alone, Y and Z as 1, nothing past 65,535 groups, as the batched clamp bounds a mesh record.
Where a batch would have opened for the record, a wait for every earlier shader write is recorded alone.
Mesh shaders declare the stage's 4-byte payload with the switch set (D3D12 refuses the stage in front of
a mesh shader without it; one with it runs without the stage), so with it unset the translations stay.

A benchmark of 9,000 mesh draws on the card (RTX 4060 Ti, driver 616.64; not committed): records clamped
every 9 draws 23.9 ms against 10.8 read as they are, through the stage 10.7 to 11.5. The stage writes
nothing: one that only declared a writable view (for the list's budget) made a wait every 9 draws cost
4.4 ms against 1.1, so the list's budget is not charged for these records (the largest record in 55 runs
asked for 2,828 groups).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: cargo check with and without
diagnostics, the batch and mesh unit tests, a new test that the payload validates in dxil.dll.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 20:55:24 -05:00
d920d850d0 Pages written since they were taken go up by the 4 KiB that changed, on by default
LEONIDA_TAKE_BLOCKS is on (0 turns it off; LEONIDA_AB can name it). By
turns of 4 s standing at 1080 to 1440 lines, no generated frames (run d271,
106 phases): the frame's median -1.69 +-0.38 ms, means -1.87 +-0.39, p90
-2.48 +-0.68, the card -1.84 +-0.32, the submitting thread -1.87 +-0.31;
10 MB sent up a frame against 27 to 28, the sends with their hash passes
1.3 to 1.8 ms of the card against 2.8 to 3.7.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: cargo
check of leonida-gpu with and without diagnostics; the shadow test
only_the_blocks_the_title_changed_go_up; run d271.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 19:44:10 -05:00
ace8a41a4b Findings: the submitting thread sampled again; copies at their place back to common
Run d267: the submitting thread waits 45 % of its samples; the rest is
spread (refreshes on the wide threads 15 %, the write watch 7.3 %, the
merge under flights' writes 6.4 %, the driver 6.6 %, the planes' presents
5.9 %, the crossings' search 1.2 %). Run d268 with the place fix: no
device error, our lists as before.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the runs
named.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 19:11:37 -05:00
4959d6b630 d3d12: hash a texture's memory with AES rounds, 2.9-5.9x faster (D3D12-GPU-TEXTURE-DIGEST-AES)
texture::digest, which tells whether a guarded texture's memory changed (at every check that is not skipped, and over all of it the first time), was a fold of 64x64-bit multiplications that ran at 23.5 GB/s at every size from 16 KiB to 256 MiB: the multiplications were its limit, not the memory. With AES-NI it is now eight 128-bit lanes of `aesenc` over 128 bytes at a time, each lane through two more rounds on its own before the lanes meet: 139, 121, 108, 114 and 70 GB/s on 16 KiB, 256 KiB, 2 MiB, 32 MiB and 256 MiB (Ryzen 7 7800X3D, best of five, `digest_speeds`). The folded one stays as the fallback. The digests are only compared with each other inside one run and none is written out, so the value may change; which version is used cannot change during a run.

A first version, whose lanes met by one round, had pairs of one-bit changes with the same digest (1,328 in a million with four lanes). `no_two_changes_cancel_in_the_aes_digest` tries pairs of one-bit changes over 520 bytes and 4 KiB of noise and of zeros: none for the real digest and for the folded one, 83 for the eight-lane version met by one round (its negative control).

AI-assisted: Claude Sonnet 5.5
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-30 18:02:27 -06:00
de69f6d376 Findings: what our own lists take of the card; only changed dwords sent up do not pay
Run d263 (LEONIDA_OWN_STAMPS=1): the sends with their hash passes 3.1-3.9
ms a frame, the compares behind submissions 3.4-4.7, the copies between
copies 0.02-0.04. LEONIDA_SEND_CHANGED (runs d264, d266): the card -1.95
+-0.16 ms a frame, the submitting thread +5.08 +-0.36, the frame's median
+0.77 +-0.33 ms; a recorded tour with it (d265) had no fault. Off.
switches.md regenerated.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the runs
named.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 18:39:58 -05:00
b597f759ec Findings: the older values sent up are not the fetch check's to mend
With the up-copy check on the game's own path for landed pages (run d259)
whole-page sends still put older values over some 66,000 card words a
second, in the same buffers as before; with LEONIDA_FETCH_CHECK=1 (run
d260: 13 to 17 fetched pieces a frame caught while a later flight was at
them) 61,000. What else puts card bytes there that never come back is not
found yet.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs
d259 and d260.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:40:14 -05:00
2c4f423ee5 Findings: the up-copy check under the merge, crossings mended on the card, the driver cache the launcher missed
What run d254's up-copy check showed (the merge's own conflicts few; some
280 refreshes a second crossing a flight's writes through another copy;
whole-page sends over the card's words), what the crossing copies cost
(runs d255, d257, d258: none in the frame, 1.56 ms of the submitting
thread), and the full driver cache that the launcher did not tell once it
was moved aside (run d256). switches.md regenerated.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the runs
named.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:10:53 -05:00
d8ca182407 Merge remote-tracking branch 'origin/main' into push/main-1130 2026-11-30 15:21:40 -05:00
3b33420c65 Findings: settling copies in the card's memory costs this PC 53 ms a frame; the DLSS output's readers
AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64), Ryzen 5 7600X: runs d252, d253.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 15:21:38 -05:00
643cad4114 Merge pull request #2726 from bobcatchris/perf/d3d12-structure-given
D3D12-SHADER-STRUCTURE-GIVEN-FORCED: Bools::given from the literals a condition forces (translator -8% CPU, DXIL unchanged)
2026-11-30 21:13:01 +01:00
87dea59b63 Findings: three list threads against eight on a six-core processor; where DLSS's output goes on Series X
AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64), Ryzen 5 7600X: runs d246 to d251.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:46:50 -05:00
f7857c4d6f Findings: the NaN-exact compares in the game: no new refusals, no pipeline waits after the first start, the card's time the same
AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64), Ryzen 5 7600X: tours d240 to d242 against d233.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 13:18:48 -05:00
8cc104d6ed Findings: the title's compute queue holds about 1.6 ms of the card's work a frame
Each list of a standing frame's operations given the queue it was submitted to, and each operation weighed by its
kind's card time in a timing run: the drawing queues about 50 ms, the compute queue 1.6 ms. Running the compute
queue beside the drawing one, as the console does, could overlap no more than that.

AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64), Ryzen 5 7600X: run d239 against timing run d183.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 12:32:52 -05:00
bad1aec475 Findings: frame generation costs a rendered frame about 6 ms on this card
By turns of 4 s standing at 1440 lines with no frame limit (run d237, LEONIDA_FG_TURNS): the frame +5.82 +-0.43 ms
by medians, p90 +10.25, the card +6.76, with DLSS 4's generator (nvngx_dlssg 310.9.16).

AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64), Ryzen 5 7600X: runs d236, d237.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 12:03:07 -05:00
f9b84a4245 Findings: the tour's rendered frames hold no flash; the card at full clocks and two thirds of its power; the waits are under 2 ms
A recorded tour scanned with motion taken into account has no one-frame flash in its rendered frames (only the
title's fade of the player as the camera swings into him). Through a tour the RTX 4060 Ti holds 2,715-2,730 MHz,
its memory at its most, 101 W of 165 W, the memory controller at 37 %. Every wait for earlier shader writes left
out by turns (LEONIDA_BARRIER_WAITS) takes 1.73 +-0.81 ms off a 75-115 ms frame.

AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64), Ryzen 5 7600X: runs d233, d234, d235.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 11:22:54 -05:00
9602e4bf4f Findings: what frame generation shows, the menu's resets, the motion vectors' units
Recorded with the shown-frame capture: generated frames across the pause menu were made along stale vectors
(fixed by the resets of daa3f47a9: 6 generated frames in the menu phases against 204, the world's unchanged);
the G-buffer's motion vectors are pixels pointing back, as frame generation is told (a warp of each dumped
frame fits best at m = +1); and what ghosts in camera sweeps is the 70 to 120 ms between rendered frames.

AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64), Ryzen 5 7600X: runs d227 to d232.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 10:46:52 -05:00
fc48622c2b A launcher for the title's dynamic resolution between 1080 and 1440 lines; the one-frame black floor was the camera
scripts\play-X-1080-1440p.ps1 starts Series X with -Lowest 1080: the title's own dynamic resolution picks the
height between 1080 and 1440 lines (output 1440p), about 13% shorter frames than play-X-1440p.ps1 on an
RTX 4060 Ti (57.0 and 59.6 ms against 66.0 and 67.9).

Findings: the one-frame dark cells of the recorded turns (d220, d226) are a dark wall crossing a cell between two
bright views in a fast turn, not a renderer fault; and frame generation's motion vectors on Series X are in the
units the title gives its own FidelityFX upscale (pixels, scale [1, 1], depth inverted, near 10,000, far 0.15).

AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64), Ryzen 5 7600X: the launcher parses; the findings
come from recorded runs d155, d174, d175, d194, d220 and d226.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 09:49:53 -05:00
986771506d leonida-shader: Bools::given from the literals a condition forces (D3D12-SHADER-STRUCTURE-GIVEN-FORCED)
`Bools::given(b, known)` restricted `b` by every atom `known` decides. It
found them one atom of `b` at a time: for each, build the conjunction of
`known` with the atom's negation (and with the atom) and compare it with
0. In `structure::finish`, which calls it for every block's guards,
branches and mask joins, that was 97 s of 114 s of a full-corpus
translation's 330 s of structure time (1.52 million calls, 5.4 million
atoms, 10.7 million `implies`).

What `known` decides is a property of its nodes alone: the literals that
hold on every path to 1. `Bools::forced` finds them in one pass over the
condition (a node's are its children's intersection, or the one child's
plus its own atom where the other is 0), and keeps them per node for the
later calls on the same condition (bounded, then it starts over); `given`
applies them to `b` in one restriction. Where nothing satisfies `known`
every atom of `b` is decided both ways and the old code took them as
true: kept (b at all-ones). The result is the same function, so the same
node.

- given_as_the_forced_literals_of_what_is_known_gives_what_testing_each_atom_gave
  keeps the old algorithm as the reference and compares it with `given` for
  every pair of 72 random functions (conjunctions of literals among them,
  and the constants), and checks `forced` against `implies` for every atom.
  With the intersection's comparison of values left out it fails.
- `restrict` (one atom) is only the test's reference now: cfg(test).
- docs/findings.md: where the translator's time goes, by stage and by size.

Output unchanged: `leonida translate` over the whole archive, the DXIL of
all 25,689 emitted programs (15,799 distinct) hashes the same in 4 runs of
the new build and 5 of the old. Wall clock 65.2/65.1/65.1 s -> 59.4/59.5/
61.6 s, CPU 890/894/889 s -> 818/820/821 s (Ryzen 7 7800X3D, 16 threads,
--release, alternating).

AI-assisted: Claude Sonnet 5.5
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-30 07:33:16 -06:00
8b46b96cee Findings: a steady frame's chain on the latest build; the list threads' three switches by turns again
Timelines of run d216: the chain is the title's threads, our list threads' ExecuteIndirect calls and, in other
frames, DirectStorage's inflating and threads waiting for a core. LEONIDA_VIEW_CACHE, LEONIDA_CONTENT_TABLES and
LEONIDA_ALIAS_QUICK by turns (d217, d218): none moves the frame; they stay off.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64 (Windows 11), Series X profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 07:54:56 -05:00
4f21bdb49b Findings: the texture queue kept by due frame takes 1.2 ms off the textures' part of the list ahead
Runs d214/d215 (the list ahead recorded by one thread, sampled the same way): the textures' part 4.64 -> 3.40 ms a
frame, the walk for due slots 2.6 -> 0.3 % of the thread's samples, the whole list 8.98 -> 7.80 ms.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64 (Windows 11), Series X profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 07:23:46 -05:00
ec1d858463 Findings: main's indexed heap spans take 1.6 ms off the frame here; what ends the indirect batches now
LEONIDA_INDEX_HEAP_SPANS by turns on the merged build (d212, d213): the frame's median -1.64 and -1.61 ms. With
LEONIDA_BATCH_WHY=1 (d211): 785-841 of 926-988 batches a frame end for programs that store through views they pick
from the heap, the culling passes that write the records first.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64 (Windows 11), Series X profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 07:02:52 -05:00
a2219a9374 Findings: night tours with and without the card's steps, the list threads and the heap pass sampled again
Runs d204/d205 (the standard tour at 23:00): no torn frames either way; the card's steps stay. Profile list-d207:
ExecuteIndirect is binding, and over half the list threads' contended waits were the placed textures' one lock;
LEONIDA_PLACED_SHARDS by turns (d209, d210): the frame does not move. Profile ahead-d208 against ahead-d201: the
spans' holds were not the pass's cost; the walk over the parts' slots is.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64 (Windows 11), Series X profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 06:32:48 -05:00
139bfb21f3 Findings: a steady frame's chain, the frame meter by turns, the list ahead of each frame sampled
Timelines of run d200: the frame comes out of the title's threads (22-30 ms a frame), its own Sleeps, our list
threads' calls and the host's Present more than out of the submitting thread; the card busy 96-99 % by our count.
LEONIDA_METER_BESIDE by turns (d202, d203): no change to the frame. Profile ahead-d201: the copies' spans are most
of the list ahead's own work.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64 (Windows 11), Series X profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 05:28:31 -05:00
37163fc265 Findings: a key shows three frames later either way; the title's own ray tracing draws right at 3-8 frames a second
Runs d187/d188 (latency.py over every presented frame, standing): median 351.9 ms with frame generation, 310.0 ms
without, the first moved frame the third presented after the key in both. Runs d189/d190 (-RayTracing): the deck's
shadows and the water look right, the frame 158-217 ms (79-267 ms of it on the card), so it stays off by default.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64 (Windows 11), Series X profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 04:49:15 -05:00
bb3c61711f Findings: the batch kept and the smoother by turns on NVIDIA do not move the frame (runs d185, d186)
And what a stable 30 frames shown with frame generation asks: 15 rendered, 66.7 ms a frame, against 71-79 now.

AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 04:07:48 -05:00
e87dba264c Findings: mesh programs' own output counts timed on NVIDIA: no gain (runs d183, d184)
The card 49.8 -> 51.5 ms a frame with LEONIDA_MESH_COUNTS=1, the six heaviest mesh programs the same or slower.
Left off.

AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 03:28:50 -05:00
0a13b51cbb Findings: main's new defaults and its helper counts by turns on NVIDIA (runs d198, d196)
Quick window finds, renderer port 2 and scoped copy forgetting together save about a millisecond here (2-3.4 ms
each on the RX 6800); kept on. Wider views and records pools do nothing, half the processors refreshing copies
makes the frame slower, the list ahead split in two saves about half a millisecond.

AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 03:05:52 -05:00
5a7c02bd03 Findings: where the submitting thread's time goes on NVIDIA, sampled (runs d180, d181)
The submitting thread works 68% of its samples and waits 32%, half of the waits in the list ahead of each frame
(the views' pool), while our helper pools stand idle (94.6-99.9% of their samples waiting) and the six list threads
are busy 76%, the tables and views a sixth of it. Next: main's wider pools by turns, then views kept past a
recording.

AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 01:50:27 -05:00
0ae217ceb1 Findings: DLSS on Series X's black world is lost after the upscale, not in its input
Runs d155, d174, d175, d194 (test build of fix/upscale-alias, not merged: the alias it reads through is not there).
The stretch in DLSS's place gives the same black world; the colour input is no texture placed over another target
and holds the lit world at the end of a frame; the title renders to and writes no texture of the output's size
(3840x2160) in a frame. Leads: the title's upscaler is made for its shipped 1280x720 to 1920x1080, and the frame's
op list stops before the lighting and post-processing.

AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 00:42:27 -05:00
6d26716aa5 Findings: R9G9B9E5 views in place by turns on NVIDIA; the pipelines waited for after a translator change
- LEONIDA_ALIAS_CAST (PR #2660) by turns of 4 s standing, two runs (d156): the card -1.73 +-1.38 and -1.31 +-0.30
  ms a frame, the frame's median +0.34 +-0.32 and -0.46 +-0.32 ms: the frame waits for the submitting thread here.
  Kept on.
- After chain30's build (new translations) the pipelines not made within their 10 s wait were 10 in the second
  run, 55 in the third and none in the fifth and sixth; two timelines of the third run each hold a frame of about
  10 s spent on one pipeline worker. Measured runs come after tours.

AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 00:07:05 -05:00
cc031f092f Findings: the G-buffer's velocity target holds the camera's motion (a slow turn's dump); frame generation's ghosting at the default is its base rate
AI-assisted (Claude). Checked on a target dump taken on an RTX 4060 Ti 16 GB, driver 616.64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 21:34:02 -05:00
c2ebff90d9 Findings: DLSS on Series X has the world black under the HUD (run d120); the test that tells why
AI-assisted (Claude). Seen in a recorded run on an RTX 4060 Ti 16 GB, driver 616.64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 21:31:38 -05:00
1747cf4071 Mesh programs: their own output counts behind LEONIDA_MESH_COUNTS=1 (off by default)
All 1,078 mesh programs of recent runs are console wave64, and their translations
pay nothing for it on 32-lane hosts: no group-shared memory, no barrier, no ballot,
no exchange between host waves; the only wave operation is WaveReadLaneFirst. So a
paired or wave-wide form has nothing to take away from them (docs/findings.md).

What the translation did pay: the counts were the declared maxima (128 and 128 for
the heaviest), with every slot culled first, so the host's primitive stage takes
every slot of every group. With LEONIDA_MESH_COUNTS=1 the counts are the program's
allocation request: M0 is made again in the deepest block before the request that
every thread runs once and that comes before every export, the group's first thread
gives it to the group through one group-shared dword and a barrier, and outputs past
the counts are not written. A program without such a place keeps the maxima
(LEONIDA_WAVE_WHY=1 says why). Without the switch the emitted modules are unchanged.
The shader cache keys on the switch (translation_fingerprint lists every LEONIDA_*
switch the translator reads; a test checks it is listed).

Tests: the place and the chain on hand-written programs; dxil.dll's validator; on
WARP a group that asks for no primitive draws nothing, as on the console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 21:15:36 -05:00
1341d658b7 Translator: saturating float-to-int, SCC of shift-adds, the division fix-up's zeros; BC7 rotation; null CBVs; freed 32-bit memory forgotten
Ported from voidopcode/vilocity's batch of 2026-11-30 (each checked against Leonida's own code first):
- v_cvt_{i32,u32,flr_i32,rpi_i32}_f32 clamp their operand before the DXIL conversion, NaN to 0 and past
  the range to its top, as RDNA 2 does (LEONIDA_CVT_SATURATE, on); s_lshl{1..4}_add_u32 set SCC to the
  carry of the 64-bit sum (LEONIDA_LSHL_ADD_SCC, on). ReTerryDavis/ReVIctory a892756, 9c99926, through
  vilocity eaa934e.
- v_div_fixup_f32 resolves 0/y and x/inf before a NaN quotient's infinity (LEONIDA_DIV_FIXUP_ZERO_FIRST,
  on). cool_fox 2b2b00fa, VIctory-NVIDIA feb90ade, through vilocity 83bcc2a. (Its s_min/s_max SCC half
  was in Leonida already.)
- BCPack BC7: control bits 4:3 rotate channels in modes 4 and 5 only. fxceless/victory-fork 06702fe8,
  through vilocity 4365d81. (Its dictionary half was in Leonida since trustno1 f9de61c5.)
- A constant buffer view made with no description is a null view, and a draw's table nulls that slot.
  makmatvey, Marvisak/VIctory#2449, VIctory-NVIDIA 8d2d77c4, through vilocity 12cf6fb.
- XMemFreeDefault's 32-bit path tells the GPU side before it releases the reservation. ZigZagBoi1/
  ScarlettPort 745d6f3, through vilocity ed024d5.

Findings: LEONIDA_WC_PARTS_NO_BACK measured and dropped (0.0 MB ever in such parts, d128);
LEONIDA_TEXTURE_HASH_BACKOFF measured by turns (frame -1.2 ms, submitting thread -2.75 ms, d118).

Tests: float_to_integer_conversions_saturate, scalar_shift_adds_set_scc_to_their_carry,
division_fixup_puts_zeros_before_a_nan_quotient (the whole valu suite, 44 passed, on an RTX 4060 Ti,
driver 616.64, and on WARP); bc7_rotation_is_only_of_modes_4_and_5; a_null_constant_view_replaces_the_
view_there_before (to run with the next build).

AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 21:14:02 -05:00
0eab02a8bc Terrain mesh dispatches run their X with Y, Z of 1; three particle emitters paired; latency from present to present
- Indirect mesh dispatch records run as [X, 1, 1], as the console reads them (X alone). The terrain's tessellation
  writes (X, 0, 0), which D3D12 drops: the near ground was in depth but missing from the G-buffer, black with white
  specks on dirt and sand edges up close. The single clamp (indirect.rs), the batched one (indirect/batch.rs) and the
  bench's (indirect/bench.rs); unfilled slots (X past 65,535) still run empty. From VIctory-NVIDIA 216bca9
  (invismann), through voidopcode/vilocity 41bccf0 (GPL-3.0-or-later). Tests on WARP:
  warp_window_leaves_unfilled_slots_empty_and_uncharged feeds (519, 0, 0); warp_batch_clamps_as_the_clamp_of_one_does
  checks [X, 1, 1] for every mesh record; both pass.
- Launcher: the model emitters CS_Emit_Dynamic_Model_Skinned, _AttachMesh and CS_Emit_Dynamic_Model (particles from
  a character's body) take the paired form (LEONIDA_PAIRED_FOR); translated alone none translates for 32-lane host
  waves and all three do paired. After voidopcode/vilocity 324fe01, 4244b51.
- Launcher: the files of NVIDIA's shader cache a precompile writes are noted; if one is gone at the next start (the
  cache emptied by hand, or a full one moved aside) the pipelines are made again instead of being compiled in the
  game (runs d76, d96: up to 480 ms a frame waiting for pipelines).
- The line: "frames waited from the title's present to ours" each second (after vilocity c04fdd7): the latency the
  line adds between the title and the screen.
- findings: the frame rate measured against the PC's own load (a restart brought back background programs: 17.3 ->
  12.8 frames a second for one build); LEONIDA_WRITE_SITES measured on/off/off/on: faults -1,000 a frame, the frame
  unchanged, left unset.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64, Ryzen 5 7600X, Windows 11 (Series X profile, 1440p).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:00:09 -05:00
b8bd371116 Image stores keep infinities; a loader relocation fix; the texture hash backoff switch; key-to-frame stamps
- Translator: with LEONIDA_NAN_SCRUB=1 the floats an image store writes keep an infinity, as on the console, and
  only NaN becomes 0 there (LEONIDA_NAN_SCRUB_STORE_INF=0: held at 65504 as before). The water's plain transmission
  volumetrics store an infinity for "no surface along this ray"; held at 65504 it was a surface 65 km off (a black
  disc toward the sun). After voidopcode/vilocity 767369a (GPL-3.0). Colours a pixel program writes are held as
  before. Test the_nan_scrub_keeps_the_integer_bits_an_image_store_writes (card and WARP) updated; it passes.
- Loader: dir64_relocations reads whole entries of a block only and no page whose entry's place passes 4 GiB
  (after edsuuu/VI-BR-PORT df2b835d7); test a_malformed_relocation_block_gives_nothing.
- Textures: LEONIDA_TEXTURE_HASH_BACKOFF (off unless asked; by turns under LEONIDA_AB): a guarded texture whose last
  4 looks behind the guard found it as it was takes one of every 16 of its turns (after kylepelham/El1xr d9fc89a4,
  GPL-3.0). A frame hashed 38 to 40 MB of such textures and found 0.0 changes the guard had not seen (run d69).
  Test a_quiet_texture_takes_one_turn_in_n.
- Diagnostics: a recorded frame's present time (frames-times.txt in the capture folder) and a log line when the
  scripted keys change, for the time from a key to the first frame that shows it.
- findings: the busiest faulting stores are the kind LEONIDA_WRITE_SITES rewrites; its notes are keyed by the
  executable's hash.

Four recorded tours with this build (runs d76, d77, d87, d96): no one-frame dark floor, no white flash; the plain
tour on a cleared driver cache (d96) has no one-frame glitch at all.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64, Ryzen 5 7600X, Windows 11 (Series X profile, 1440p).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 19:21:03 -05:00
dc64c3685f Six list threads by default; findings: the title's stores that change nothing, the aliased views' copies
- play-nvidia.ps1: LEONIDA_THIN_THREADS=6. Two of eight list threads parked by turns of 4 s (LEONIDA_THIN_PARK),
  standing at one save, two runs: the frame's median -0.83 +-0.16 ms (d69) and -0.94 +-0.52 (d73), the
  submitting thread -0.49 +-0.12 and -0.74 +-0.62.
- findings: the fault handler is entered 2,400 to 2,950 times a frame, of which some 2,000 are single stores done
  beside the guards, most of them storing what the memory already holds; the loader's rewrite of such places
  (LEONIDA_WRITE_SITES) is not set by the launcher and is the next thing to measure.
- findings: the copies behind aliased views could go with relaxed format casting (driver 616.64 has it).

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64, Ryzen 5 7600X, Windows 11 (Series X profile, 1440p).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 17:09:28 -05:00
8085eab2c2 A list keeps its dynamic slots' resources once, on; six list threads against eight by turns; the async line's switch
- LEONIDA_KEEP_BY_LIST is on (ReZOnGithub/VIctory-lap 1641cb6): by turns of 4 s standing (runs d65) the frame's
  median -1.33 +-0.58 and -0.51 +-0.25 ms, the submitting thread -0.51 +-0.28 and -0.53 +-0.15; the closed lists
  from the recycling thread -1.33 +-0.58 and -0.44 +-0.25 by the same runs (on since the last commit). A tour with
  it on (run d66): no device removed, every texture whole, the flagged frames the same kinds as without it (the
  newly shown deck's dark frame, the camera's cuts), and no program of the title untranslated any more (the two
  particle programs paired).
- LEONIDA_THIN_PARK (off unless asked for; by turns under A/B): the last LEONIDA_THIN_PARK_N (2) of the threads that
  translate lists sleep, to measure six against eight in one run; the title's threads wait for a core on the frame's
  chain (timeline d59, 3.2 ms a frame).
- findings: the particle programs in the game; switching LEONIDA_ASYNC_SUBMIT off by turns ends the title (run d67).

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64, Ryzen 5 7600X, Windows 11 (Series X profile, 1440p).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 14:53:50 -05:00