Commit Graph

36 Commits

Author SHA1 Message Date
43af833d19 Merge remote-tracking branch 'origin/main' into carry/hwrt-2972
# Conflicts:
#	d3d12/docs/switches.md
2026-12-02 07:40:14 +01:00
5b005f8bb9 d3d12/docs/switches.md: list LEONIDA_FSR_MAX_SCALED
The merge queue's tests found the page out of date once this branch met main.
Regenerated with tools/d3d12_switches.py after merging main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 06:31:19 +01:00
5a8e1db178 Merge remote-tracking branch 'origin/main' into d3d12-hardware-ray-tracing
# Conflicts:
#	d3d12/crates/leonida-gpu/src/descriptor/host.rs
#	d3d12/docs/switches.md
2026-12-02 01:20:51 +01:00
9cedb84c93 d3d12 hwrt: review fixes (transform opcodes, no hardware path without DXR 1.1, cleanup)
- rq_op: 187 is CandidateWorldToObject3x4 and 188 CommittedObjectToWorld3x4 (they were
  swapped; checked against dxc 10.0.26100). the_ray_query_opcodes_are_dxils pins all 35.
- Hardware ray tracing runs only where it can: hwrt::active() (asked for, and a DXR 1.1
  manager made) gates the HLE module, the left-out passes, the copy-back rule and the counters;
  the translator lifts loops only when the host says it runs inline ray tracing
  (set_host_inline_rt, in host_settings and so in the shader cache's key). Elsewhere the title
  keeps its own XboxBvhBuilder.dll and the software walk.
- No env write: builder_allowed() is LEONIDA_BVH_BUILDER=1 and not hwrt::active().
- dxr.rs removed (nothing bound its wrappers); TLAS views are kept out of the list views only
  with the path on; the off16 diagnostics and the xmem log lines are gone.
- as_sizes split out of alloc_or_reuse_as, with a test; the known gaps are in
  fork-ray-tracing.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 00:01:01 +01:00
7c69bc8b19 d3d12: the threads of a frame share its pipeline wait budget and none is left with nothing (D3D12-COLD-START-SKIPS)
The shared frame budget was a reservation: the first recording thread to
wait in a frame took all that was left of it, and every other thread of
that frame (and any thread still on an older frame) got nothing, so its
draw went out without a wait and was dropped as not made. On first starts
(no pipeline book) 400 to 3,600 draws, dispatches and indirect executions
a frame were dropped at the arrival in the world, and the character's
head, drawn by a pass the title runs once, stayed missing for the run.

- The frame's waits are counted once over the threads that wait at the
  same time: what passed while at least one thread waited. A thread that
  begins to wait while others do is left what is left at that count, so
  waits that overlap still cost the frame its budget once; the time a
  thread records between two waits is not counted; a thread on an older
  frame joins the current frame's waits and opens no budget of its own
  (#2601). On by default; LEONIDA_PIPELINE_WAIT_DEADLINE=0 reserves the
  frame's budget as before (no effect with LEONIDA_PIPELINE_WAIT_SHARED=0);
  LEONIDA_AB can turn it while the title runs.
- A pipeline's own budget (LEONIDA_PIPELINE_WAIT_ONCE) is charged the same
  way, the real time once, not the threads' times added up, whatever the
  sharing of the frame's budget (LEONIDA_PIPELINE_WAIT_ONCE=0 turns that
  budget off).
- The queue a wait moves its pipeline forward in and the budget a
  pipeline's waits count against are passed in, so that tests cover them;
  one line tells the rules in use at the first wait.

AI-assisted: Claude Code (Claude Opus 5.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:10:50 +01:00
3fdfbaa46f d3d12: hardware ray tracing on DXR 1.1 (LEONIDA_HW_RT, off: a trial)
In place of -RayTracing (the title's structure builder and software traversal as translated
shaders): the title's XboxBvhBuilder calls become host DXR 1.1 bottom and top levels, and the
traversal loops of its trace programs become inline ray queries.

Ported from trustno1-coder/VIctory-NVIDIA (its #3706; from Leslie-d-a/VIctory-NVIDIA-HWRT 61e389e0
and 5f55bca8, original by dakisback2 ecc49d5b and 72f8316a), GPL-3.0, and fitted to this tree:

- leonida-shader: emit/rayquery.rs wired into lower.rs (the plan, the handles, TLAS root SRVs
  t230..t241, the analyses that leave the lifted loops out). A program in the paired form is not
  lifted. With LEONIDA_HW_RT=1 the node test of a loop left unlifted misses every node
  (emit/intersect.rs bvh_miss): the console structures are never written then.
- leonida-gpu: hwrt.rs (and dxr.rs for its records); list::external with a LEONIDA_THIN op for the
  structure work at its place in a title list; the TLAS views in the descriptor heaps;
  Deferred::held; the ray queries in the shader cache's entries; counters in the frame log.
- leonida-hle: modules/xboxbvh.rs replaces the exports of the title's XboxBvhBuilder.dll when on.
- With it on the light stand-in stands aside and the passes left out without structures run.
  Shader writes are not all copied back as VIctory-NVIDIA does (LEONIDA_HW_RT_COPY_BACK=1 asks for
  it): here that stretched and flickered textures and cost 30 to 45 ms a frame.
- F1: HARDWARE RAY TRACING (TRIAL); play scripts: -HardwareRT (frame generation left off with it,
  as with -RayTracing); launcher: a checkbox. Docs: fork-ray-tracing.md, README.md, switches.md.

One PC (RTX 4070 12 GB, driver 621.40, Series X profile, no frame generation): 22 to 25 frames a
second against 6 with -RayTracing; the run ended after six minutes with the card's memory full.

Co-authored-by: dakisback2 <90546900+dakisback2@users.noreply.github.com>
Co-authored-by: Leslie-d-a <70692092+Leslie-d-a@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 23:04:12 +01:00
597e2d9226 Merge remote-tracking branch 'origin/main' into reaper-bounded-queue
d3d12/docs/switches.md regenerated with tools/d3d12_switches.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:30:24 +01:00
7be7711c8e Merge remote-tracking branch 'origin/main' into reaper-bounded-queue
d3d12/docs/switches.md regenerated with tools/d3d12_switches.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:12:31 +01:00
fe612066ac gpu: drop neon green and blue garbage from the probe resolve on request
The light pass already drops magenta from what the title's probe resolve
left (LEONIDA_AMBIENT_MAGENTA, on). LEONIDA_AMBIENT_GREEN=1 drops a green
far above red and blue, LEONIDA_AMBIENT_BLUE=1 a blue far above green and
above red, with the thresholds of lobomfz/VIctory-xmem 5a60834 (from
coastingVI via dfmbrollins/victory-linux-nvidia, GPL-3.0).

Both are off by default: the garbage was seen on Linux with RADV, not yet
on a Windows driver, and a strongly green or blue light that is real would
be dropped too. A new test compiles the part with every drop on and off;
it fails when a define the shader reads is missing.

On an RX 6800 (Windows 11, driver 32.0.21030.2001) with both on, a
save loaded into the world: the light passes were made with the drops
compiled in, and the picture showed nothing wrong over about 4 minutes.
No frame was compared with them off.
2026-12-01 12:02:15 -05:00
2d769e5f46 hle: skip the title's Bink movies on request (LEONIDA_SKIP_BINK)
LEONIDA_SKIP_BINK=1 skips the movies that play once (logos, the intro);
=all skips the looping ones too (menu backgrounds, which then stay dark).
Unset, nothing changes and no import is bound anew.

The title's Bink DLL still opens every movie. The exports a player loop
calls on an open movie (BinkWait, BinkDoFrame*, BinkNextFrame, BinkGoto,
BinkShouldSkip, BinkClose) are bound to wrappers that put a skipped movie
on its last frame and keep it from reaching the DLL, so the title's own
end-of-movie check closes it. The executable's imports and those of DLLs
the title loads later go through the wrapper; GetProcAddress does not.

The technique is from fxceless/victory-fork (pull request 613, by
C-GDev), as carried by trustno1-coder/VIctory-NVIDIA and
lobomfz/VIctory-xmem 0a4aadf (GPL-3.0); written anew for this loader.

Checked on an RX 6800 (Windows 11, driver 32.0.21030.2001): with =1 all
eight wrapped exports the executable imports from Bink2Scarlett.dll are
bound to the wrappers. Booting with no save and pressing Enter, the first
movie (3840x2160, 450 frames, not looping) was skipped and the title went
on to its setup screen. The unit test fails when the wrappers are not
bound.
2026-12-01 11:48:05 -05:00
c648ec4bdf Merge remote-tracking branch 'origin/main' into fix/ahead-split-kept-thread
# Conflicts:
#	d3d12/docs/switches.md
2026-12-01 17:03:17 +01:00
49ef42d706 Merge remote-tracking branch 'origin/main' into reaper-bounded-queue
d3d12/docs/switches.md regenerated with tools/d3d12_switches.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:30:27 +01:00
d096ddc728 switches.md regenerated: LEONIDA_WINDOWS_BAR_LINE, LEONIDA_WC_SUBRANGE_NO_BACK on by default
AI-assisted (Claude).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:23:56 -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
a6f835ef0f Merge remote-tracking branch 'origin/main' into reaper-bounded-queue
d3d12/docs/switches.md regenerated with tools/d3d12_switches.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:23:20 +01:00
dd4829ecfc Merge remote-tracking branch 'origin/main' into push/main-1130
# Conflicts:
#	d3d12/docs/switches.md
2026-12-01 07:52:21 -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
96d3ad2082 d3d12: switches.md lists LEONIDA_LIST_LOCK_FAST
Refs #2707
AI-assisted: yes
2026-12-01 02:57:12 -08: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
095af0c96e Legacy multiplies can be plain products on any host where the zero rule cannot apply (LEONIDA_LEGACY_PLAIN, off)
The title's programs multiply with v_mul_legacy_f32 (0 x anything = 0): 5,968,915 of them in the 25,734
programs, 13.2 % with a constant against a vector register and 1.1 % against a scalar one. Off the RDNA host every one
became a product, two compares, their or and a select. With the switch, what of the RDNA host's forms holds for any
host's floats goes everywhere: a plain product of two factors known to be finite or with a finite constant that is not
0, and only the finite factor's zero asked where one of two is known finite. A product of a finite factor and a zero
keeps the sign the product gives, as on the RDNA host, instead of +0. Off until measured.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: a new test runs each form on the card and on WARP
over zeros of both signs, ones, tiny and huge values, infinities and no number, against the spelled-out form (the
same but for a zero's sign), and checks that the forms by a constant and of a saturated value are shorter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 23:27:55 -05:00
247e27d912 Merge remote-tracking branch 'origin/main' into reaper-bounded-queue
d3d12/docs/switches.md regenerated with tools/d3d12_switches.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 05:15:46 +01:00
169c990609 Merge remote-tracking branch 'origin/main' into fix/ahead-split-kept-thread
# Conflicts:
#	d3d12/docs/switches.md
2026-12-01 05:00:53 +01:00
a59fe07402 gpu: the split list ahead's textures half runs on one thread kept for the run (LEONIDA_AHEAD_KEPT_THREAD, on)
With LEONIDA_AHEAD_SPLIT, record_ahead_split made a new OS thread with an
8 MiB stack every frame for the textures' half of the list ahead, chose the
fast cores for it and logged a line, all on the path of the line's thread,
which waits for that half (14,271 such lines in about 2.5 minutes of play on
an RTX 4070 Laptop / Core Ultra 7 155H).

One thread is now kept for it (queue::beside::Kept, made at the first split,
pinned once); each frame's half is handed to it and waited for, with the same
panic and fallback behaviour. LEONIDA_AHEAD_KEPT_THREAD=0 brings back the
per-frame thread, and LEONIDA_AB can switch it. Measured with LEONIDA_AB
every 10 s on that machine (18 steady phases a side): the line's thread stood
2.5 ms a frame for the list ahead with it, 5.2 ms without; the frame median
moved 55.6 -> 54.4 ms, within its spread.

switches.md regenerated (it also picks up two rows main had stale).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:56:34 +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
e22a5ea7a9 Lists' scratch in the card's memory keeps spares to the card's budget, guards against churn, and is on again for big cards
TheGeogeo turned LEONIDA_SCRATCH_CARD off by default (f8ad7e245, #2819) "until the card's spare chunks are kept by
size": the card's pool kept 256 MiB of spare chunks in all, in the order they came, and let go of every chunk given
back past it, so the lists' resets freed chunks the recording threads made again (1,158 a second and 35 ms a frame
of MakeResident on an RTX 3090). Now:
- the card's spare chunks are kept up to a sixteenth of its budget, between 256 MiB and 1 GiB
  (LEONIDA_SPARE_CARD_MB=<MB> says it), and when the pool is full those kept longest go, not the one given back
  (Spare::give_evicting); LEONIDA_SPARE_CARD_GROW=0 keeps the old pool, LEONIDA_AB can name it;
- a guard sends new chunks to the PC's memory for the rest of the run if more than 1,000 are made in the card's
  within 10 s (100 a second; this PC's worst was 48 with the old pool), said once;
- with both, card scratch is on again where the card's budget is 9 GiB or more, as before #2819.
Measured before the change (run d281, RTX 4060 Ti 16 GB, by turns of 4 s standing, the old pool): card scratch on
against off, the frame's median -1.15 +-0.36 ms, the card -1.72 +-0.30, with 48 chunks a second made in the card's
memory and 3.7 ms a frame waited for their residency.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: cargo check with and without diagnostics, the
two new tests (the default by card and switch, the pool letting the oldest go); in-game A/B to follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:39:44 -05:00
200a55e29f leonida-gpu: bound the reaper's line (LEONIDA_REAPER_LIMIT)
The reaper thread's channel had no bound and nothing slowed its senders.
On an RTX 3090 its line grew to hundreds of thousands of things in most
runs; the landed host lists waiting there kept their scratch chunks, and
the runs that were not stopped ended in a device loss as private memory
neared Windows' commit limit, while LEONIDA_REAPER=0 kept memory flat. The lists' scratch was in card
memory; it is in PC memory by default since #2819, where the line should
stay short. This bound is the safety net for LEONIDA_SCRATCH_CARD=1 and
any other cause of a backlog.

Once the line (REAPING) holds LEONIDA_REAPER_LIMIT things (4096 by
default; 0: no bound, as before; LEONIDA_AB can turn it on and off), what
the host is done with is let go of by the thread done with it, as
LEONIDA_REAPER=0 does. land(), bury() and fronts_let_go() go through one
helper (reap), which counts each batch as the reaper thread takes it off;
the check and the count are one atomic step (hand_over),
so the line holds fewer than the bound and one batch however many threads
send. A batch comes off the line also if letting it go panics. The first
time the bound takes hold is logged once; the census memory line counts
what was let go in place (REAPED_IN_PLACE) and says the bound.

Diagnostics only: host lists and preludes made per frame by the title's
threads, the submitting thread and the others, with their time; a SPLIT
slot for preludes made and recorded; HostList::reset split into what the
list held let go and the allocator and list resets.

Claim: D3D12-REAPER-BOUNDED-QUEUE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 04:33:11 +01:00
023043bfe1 Merge remote-tracking branch 'origin/main' into push/main-1130
# Conflicts:
#	d3d12/crates/leonida-gpu/src/host.rs
2026-11-30 22:22:07 -05:00
23767aff86 The relay can land up to the title's first signal and tell it at once (LEONIDA_RELAY_EACH, off)
The thread that lands what flights wrote took every flight the card had run before it told the title anything:
the title's fence was signalled only after the flights behind its signal had landed too. With the switch it lands up
to and with the first signal of the title's among them. After ImTaneax's VIctory-RTX3050-4gb bd79bb1
(VICTORY_RELAY_EACH, GPL-3.0), where the title polled 32 to 81 ms a frame for the card on a walk and two A/B walks on
a 4 GB laptop card had 5 of 6 comparable pairs faster, -8 ms on average. Off until measured here; LEONIDA_AB can
name it.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 21:58:24 -05:00
f8ad7e2455 d3d12: lists' scratch stays in the PC's memory by default for now (D3D12-SCRATCH-CARD-OFF-BY-DEFAULT)
Part of enlighted's D3D12-REAPER-BOUNDED-QUEUE, agreed with them. Card scratch, on by default where the
card's budget is 9 GiB or more and it has a GPU upload heap, churns chunks: SPARE_CARD keeps 256 MiB in all
and gives back an exact size only, so chunks of other sizes are let go in the list resets on the reaper and
made again on the recording threads. The reaper falls behind and the memory it holds piles up. Measured on
an RTX 3090 with a resizable BAR (23 pairs): frame median 64.6 ms with card scratch against 33.3 ms without.
It is off by default until the card's spare chunks are kept by size; LEONIDA_SCRATCH_CARD=1 still puts it
there and LEONIDA_AB still switches it. A card that used to get it says once that it is off now.
switches.md is regenerated for that row.
2026-12-01 02:40:18 +01: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
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
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
a4fcebbf1d Shader translator: float compares and the NaN scrubs tell a NaN by its bits (LEONIDA_NAN_EXACT, on)
The NVIDIA driver compiles DXIL under fast math and may fold a float compare's NaN case away. The title's NaN
guards are such compares (v_cmp_u_f32 x, x; v_cmp_neq_f32 x, x), lowered to fcmp uno / une; a NaN that passes
one reaches the temporal filters, where it spreads as black blocks that grow frame by frame. Every
v_cmp_*_f32 / _f16 but f and tru now tests both operands with the integer check is_nan_f32 already used
(|x| > the bits of infinity): ordered compares are the ordered compare and no NaN, unordered ones the ordered
compare of their sense or a NaN, o and u the NaN test itself, so no unordered fcmp is left. The NaN of
v_cvt_u16_f16 / v_cvt_i16_f16 is found the same way, and so are the NaN and infinity tests of the scrub of
colours and image stores (LEONIDA_NAN_SCRUB), which were unordered compares too. LEONIDA_NAN_EXACT=0: as
before. The shader cache keys on the switch (translation_fingerprint).

Ported from voidopcode/vilocity 598050b (INFIERNOXIII, GPL-3.0-or-later; after the Whiplash-NVIDIA team's
nan_exact), written into Leonida's lower.rs; the scrubs are ours.

Test: float_compares_with_nan_on_the_device (the fourteen compares other than f and tru against quiet,
signalling and negative NaNs, infinities and signed zeros, on the RTX 4060 Ti and WARP; f and tru are left out:
WARP's device is removed at a dispatch of an fcmp false). The existing NaN tests (v_cmp_lg, med3, the 16-bit
conversions, the scrub's integer bits, division fixup) pass with the switch on. docs/switches.md made again.

AI-assisted (Claude). Tested on an RTX 4060 Ti (driver 616.64) and WARP: the named tests above.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 12:39:08 -05:00
bf85962d40 docs: say what the count of the switches page counts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 10:52:27 +01:00
f98f4973ec docs: what the judge of the switches page found
The launcher column saw one way of assigning of four, three kinds were wrong,
names read by turns through a constant, a function or asked_for! were missing,
and test modules with a brace in a raw string were cut short. measuring_fps.md
now says how to give LEONIDA_AB to the launcher and what GPU_TIMING and
PROFILE need.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 10:42:33 +01:00
589b2d28fa docs: how to measure the D3D12 runtime's frame rates, and its LEONIDA_* variables
d3d12/docs/findings.md was reachable from d3d12/README.md alone, so a night of
runs repeated measurements it already holds. Index it, point AGENTS.md at it,
say how to measure (a switch by turns inside one run), and list the variables
the runtime names from its own sources: 415 of 669 were in no Markdown file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 10:29:56 +01:00