Skip to content

d3d12: forget write-combined and GPU read-only regions over a released allocation (D3D12-WC-REGIONS-ON-RELEASE) - #2703

Closed
Kal0s-design wants to merge 264 commits into
ProjectLeonida:mainfrom
Kal0s-design:fix/wc-regions-on-release
Closed

Kal0s-design wants to merge 264 commits into
ProjectLeonida:mainfrom
Kal0s-design:fix/wc-regions-on-release

Conversation

@Kal0s-design

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: D3D12-WC-REGIONS-ON-RELEASE (#2570 (comment))

Depends on: conflicts with #2569 at the top of title_memory_freed in watch.rs (#2569 already conflicts with main in other files). Whichever lands second needs a small rebase.

What and why

watch::title_memory_freed passes its own len to shadow::write_combined_freed. A release (XMemVirtualFree/VirtualFree with MEM_RELEASE) has len 0, and for 0 write_combined_freed drops only the regions whose start equals the allocation's base. A region recorded for something inside the allocation outlives the release:

  • a write-combined commit (0x400) inside a reservation that wasn't asked for write-combined;
  • a GPU read-only part. xmem.rs records these for the parts the title splits a placeholder into, and its 32-bit graphics heap comes that way.

After the release, a new allocation at those addresses counts as write-combined (LEONIDA_WC_NO_BACK, on in play-nvidia.ps1) or GPU read-only (LEONIDA_GPU_READ_ONLY_NO_BACK, on by default). Its shader writes are then left on the card and never come back to title memory, the one failure these switches must not cause.

The change: on a release, title_memory_freed forgets the regions over the allocation's own extent, allocation_end(at, at), which it already asks for the views just below while the memory is still there. A decommit keeps its length, and write_combined_freed itself is unchanged, so its existing tests keep their meaning.

I found the same gap while reviewing the write-combined port in TaynanGT/Vice-Tay#462 (the same code from trustno1-coder/VIctory-NVIDIA), where it was fixed the same way. Here it also covers the GPU read-only list, which write_combined_freed forgets too.

Tested

  • New test shadow::write_combined_tests::regions_inside_a_reservation_go_with_it. It reserves 4 MiB, commits a write-combined part and a GPU read-only part inside it, records both, releases through title_memory_freed(base, 0) and checks both regions are gone. On main (dcba958) it fails with a write-combined commit outlived its reservation; with the change it passes, along with the two existing tests in the module.
  • cargo test -p leonida-gpu --lib: 560 passed, 0 failed, 50 ignored. cargo test -p leonida-hle --lib xmem: 22 passed.
  • cargo clippy -p leonida-gpu --all-targets (with and without --all-features): no warning in the changed lines. The workspace-wide -D warnings run stops on main already, in leonida-lua and leonida-shader.
  • Windows only. Linux and macOS are not covered (the code under test is Windows-only).

GPUs tested: n/a (CPU unit tests)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

aslan2142 and others added 30 commits November 26, 2026 17:37
…t probe their memory again (RT-TITLE-TEXTURE-WRITE-TRACKED)

A pending stream texture whose first bytes arrive through a noted write (the pending slot-70 views case of
d3d12_existing_heap) kept its cached unreadable answer and was never filled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…the GPU (8c579b7)

runtime/README.md: the sparse arena changed the LEONIDA_IMPORT_BELOW_ARENA row and the texture work removed the LEONIDA_ORDER_TEXTURE_UPLOADS row next to it; the arena's row is kept and the removed row stays removed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The T# records, the room lists and the texture and room changes of descriptor-refill now live in the exact-range
index of slot-records-index. src/console_heap_slot_records.h: a third index, by T# address (the exact range
[address, address + 1)), of the same groups with a settled and a waiting list; a texture gone visits exactly the
T#s recorded for its address, a texture added the waiting ones. The records waiting for room (V# halves refused a
geometry copy, T#s refused for a full bindless array) are kept in a list per kind with each record's place, so a
record leaves it in O(1) and room made visits only the records waiting for it. Interface as descriptor-refill
has it (states, set_texture, base, textures, textures_waiting); device code, README rows and both sides' docs kept.
32 bytes a half.

Tests: console_heap_slot_records_test, both sides' cases (60,010-slot release; 300,000 slots in 74 blocks, a
40-byte release looks at 3; 400 random rounds against a full re-resolution; a texture registered looks at the 10 of
60,015 waiting on its address; room changes touch only the records waiting for room); a copy that skips settled
lists on a removal fails. Linux ctest 115/115.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/README.md: the console-heap rows come from the refill branch, the shadow rows from ProjectLeonida#1867.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…nd a kernel write in progress is waited out, not read (RT-TITLE-TEXTURE-WRITE-TRACKED)

Run 57 showed 99.9 % of the arms refused, 60,637 tiles not armed and about 8,700 textures looked at per pass
(60-68 ms a pass). The refusals were this watch's own: a tile with any page not committed was refused, so
every streamed texture registered before its memory arrived was named and its arming retried at every pass,
and a texture never filled because its memory was not readable was named again at every pass too.

Now pages not committed are left as they are: xmem's commit or mapping bumps the tile's cell, and the mapping
change makes the textures over it probe their memory again. A texture whose memory is not readable is not
named again until then, except one the title mapped (its pages may be committed under the Map pointer). A tile
pinned for a kernel write is busy: the texture is not read (which uploaded half-written textures at every pass
until the write ended) and is read once the pin is gone. Only a tile whose guard cannot be set is read at every
pass. The log line counts busy looks and arms apart from refusals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wait for the write (9aed60a)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…holds; a record is looked at once an index a submission

One world run with the merged index showed 60,000-135,000 records looked at per submission for 1,300-2,600 slots
fixed again and 130-210 changes. Two causes in ConsoleHeapSlotRecords::touched:

- An addition (an alias range, title memory, a backing) visited every waiting record whose range overlapped it.
  Waiting V#s with large spans (data words that read as V#s of up to 4 GiB into title memory) were visited by every
  addition anywhere inside their span, at nearly every submission, and fixed again to no effect. A V# resolves only
  through an alias range, backing, copy or title memory that holds its base (or a backing that holds its refused
  target), so an addition now visits the waiting records whose range starts inside it; the groups with waiting
  records are kept by start a second time for this, so only those are walked. TitleVaAliases tells title memory as
  the merged range it is now part of (a V# whose base lies in the older part may fit only now), and nothing for a
  commit inside a range it already has.
- A record named by several changes of one submission was looked at once per change. Each group's two lists now
  carry the touched() call that last visited them, so a record is looked at once an index a call at most.

Test: 5,000 waiting halves of 4 GiB; 200 additions inside their spans that hold no base look at none (the previous
index looked at all of them 200 times and fails), one that holds 10 bases looks at those 10; 200 removals over the
same 5,000 resolved halves look at each once. The 400 random rounds against a full re-resolution still pass (slots
fixed again there 81,005 -> 75,919, looked at 133,506 -> 97,952); a copy whose removals skip waiting records fails.
Linux ctest 115/115.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mission (67863b3)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… on several threads, and submits their uploads in order (RT-TITLE-TEXTURE-WRITE-TRACKED)

Run 58: with the watch in effect a pass still read, hashed and detiled every named texture on the title's
submitting thread, one after another: about 1,250 textures and 95 MiB a pass in the world load, 198 ms a pass,
up to 795 ms (read from write-combined title memory, a full hash, the detile into the upload slot).

The upload is split into three steps (TitleImageUpload::reserve, fill, commit). The pass reserves a slot for
each named texture on its own thread, a small pool of threads of ours (TitleReadPool, a quarter of the cores,
at most seven, plus the submitting thread) copies, hashes and detiles them in batches of 16 or 64 MiB, and the
submitting thread then records and submits the transfers one by one in key order, still before the submission
whose draws sample them. The reads of different textures are independent; only the submissions carry the
ordering, and they stay where they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…transfers committed in order (d170028)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d to it; a rewritten V# whose range waits takes that answer

Two findings from one world run (every slot records line: 0 refills; fixing slots 18.2 ms a submission).

T#s: the title rebuilds T#s of the layer's textures from 32 bits. The run's unbound T#s name 0x7f0000021400 for the
layer's 0x100021400 and 0x2ef600 for 0x1002ef600 (bits 32-39 clear, 0x7f or 0 in bits 40-47): "its low 32 bits name
a texture of ours that is gone" (291-3,794 a window) and "no title memory and no texture of ours" (270-4,585, low bits
past the last address handed out: textures still to come). They were recorded under that address, while a texture's
arrival is announced at the layer's address, so no arrival ever reached them, and bind_title_image looked them up by
the exact address only. tsharp_texture_key maps such an address outside the title's memory to the layer's texture
address with the same low 32 bits (while fewer than 2^24 were handed out); the T# waits under it, and
bind_title_image takes the texture there when its shape fits (another shape stays unbound, as before).

V#s: about 2,100 rewritten V# halves a submission, 70% resolving to nothing at about 9 us each (the alias table,
the backings, the geometry copies and the title memory walked again, VirtualQuery included), 63% with words seen
before. A waiting record is fixed again by every change that could let it resolve, so while one waits its answer
stands: a rewritten half whose exact range another half of the heap waits for takes that answer
(ConsoleHeapSlotRecords::waiting_answer, one hash lookup; a half that asks for a geometry copy only from one that did,
and not after geometry room was freed since the refresh). To keep answers current, the submission's changes are
applied before the rewritten slots, and the changes noted during the pass (a window a fix made, a buffer another
thread released) are applied to the heap before an answer is taken (sync_slot_changes). The records keep a third
list per range for waiting halves that asked for a geometry copy. The slot records line counts the answered halves.

Tests: d3d12_tsharp_refill_test also writes the texture's T# in the title's two 32-bit forms before the texture exists
and expects both bound at the first submission after it appears, and gone with it. d3d12_unbound_tsharp_rules_test:
the 0x7f form with the texture's shape binds (it expected "no texture"). console_heap_slot_records_test: in the 400
random rounds half the writes take a waiting answer after applying the changes noted so far, and each answer must be
what resolving at that moment gives (a copy that skips applying them fails); the rounds still equal a full
re-resolution. Linux ctest 115/115.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om it; textures are read at first use and by their written tiles (RT-TITLE-TEXTURE-WRITE-TRACKED)

Blocks of older frames in run 58: a texture without GPU-write flags placed over the memory of a GPU-written
one (a render target, depth or UAV texture) was filled from the title's pages there. Those pages never hold
what our GPU renders into the target's image, only what the CPU last put there, and every write mark over
them (a write-back of a GPU copy, a neighbour's write in the same tile) re-uploaded those old bytes. The
registry now keeps the CPU-view range of every GPU-written texture (DeviceState::gpu_owned), and a texture
over such a range is not watched or filled by the refresh (index_texture); one already watched stops when the
target is registered. Test: d3d12_existing_heap's "texture over a render target's memory" (fails without
this: the written 64 KiB piece shows in the texture).

Upload at first use: a title texture no descriptor names is not read, uploaded or watched. Its first
descriptor of any kind (a D3D12 view, a slot-70 view, a T# the title wrote into a console heap: all reach
Resource::note_shader_view) queues it, and the refresh before that submission reads it whole and uploads it.
A texture whose descriptors are all gone later stays on the write-driven path (nothing counts them down).

Reads by written tiles: each texture keeps a hash of its part in every 64 KiB tile (TilePieces). When some
of its tiles were written, those parts are hashed in place first; equal, and the texture is unchanged
without a whole read. The watch reports writes per 64 KiB tile (the geometry cells' fault reopens a whole
tile), so a neighbour in a written tile costs its share of that tile, not a read of all of it.

The 10 s line: textures written or new, read whole, found unchanged by their parts, uploaded, named for the
first time, not named by any descriptor (not read), ms a pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#s in the title's 32-bit form wait under our address (d94b6c3)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…re's first descriptor, written parts hashed (f7c3df1)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…y resolve to the render target's image (RT-TITLE-TEXTURE-WRITE-TRACKED)

f7c3df1 stopped filling such a texture from the title's pages; its own image then held nothing the GPU
drew. A GPU-written texture placed at the address (render target, depth or UAV) now answers first, for
console T#s (bind_title_image) and slot-70 views (place_title_view), when the description fits: the T#'s
extent and samples, and mips and layers within the target's (TitleGpuPlacements::matches), in any format the
target's image takes a view in (its own, a castable one, or one its view list allows). Otherwise the other
texture answers as before, and the reason is counted (format; extent or samples; mips or layers) in a line
next to the refresh's.

Either order at one address: a render target placed over a texture placed first leaves that texture's
registry entry in place and drops its T# bindings, so they bind again, to the target. The ranges GPU-written
textures cover are kept by the resource (DeviceState::gpu_owned), so a texture placed later at the same
address does not take the target's range away; when the target goes, the texture at its address is filled
from memory again and its T#s find it. D3D12 views the title made of the plain resource itself still name
its own image.

Test: d3d12_existing_heap's "view over a render target" (both orders, and the target's release).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom timestamps

A diagnostic, off by default. Each submission on a queue whose family has
timestamp bits gets a query pool, reset once at the start of its command
buffer, and bottom-of-pipe timestamps: after the opening barrier and
bindless upload, before each run of consecutive draws or dispatches of one
pipeline, after a run that another command follows, and at the end. The
difference between two consecutive timestamps is what lies between them
added to the queue's work: a run's GPU time, or "other" when no draw or
dispatch lies between. The results are read on the fence callback once the
submission is done, never waited for, and summed by pipeline under its
stages' ShaderLibrary names (as the pass trace prints them), else its id.

Every 10 s, [rt] gpu profile lines give per frame the compute, graphics
and mesh totals, other work, per queue kind the busy time (measured as
LEONIDA_GPU_LATENCY does) against the timestamped span and the share in
draws and dispatches, and the 20 pipelines with the most GPU time (ms per
frame, share, kind, calls per frame, ms per call).

PSOs register their names with the context when the profile is on, as
they already do for the device-fault report; the device passes the
families' timestamp bits to the context. Off: one test per submission and
per command. On: about 1 us per timestamp on the Raphael iGPU, submit to
idle (vk_gpu_profile_test).

vk_gpu_profile_test runs known dispatches of two pipelines and a draw
through VulkanQueue and checks each pipeline's name, calls, runs, a time
that grows with its loop count, and that the intervals add up to the span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e target's image (14d436c)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…reads and writes those pages through the frame table (RT-MEMORY-MODEL)

Step 2 of the memory model. After step 1 the console queue's CopyPageMappingsBatchX gave a paired GPU-only page its
physical page by table, but still host-mapped the paired CPU page (the "twin") for the D3D12 layer and DirectStorage,
which read and write GPU-only memory there: one unmap plus MapViewOfFile3 per page through Wine's server. In the newest
local world run that was 47% of slot 31's pages and most of its 1.7-2.5 s of mapping per 10 s. By the log every host
remap was such a twin (pages by table minus pages by host equals the twins the title mapped itself, which are kept);
destinations with no CPU pair were none.

Now the twin is a table page too (map_table_page), and the host reaches table pages through their frames:
- src/title_frames.h: xmem's lookup (page -> its section's scratch view, held alive), its peers, monotonic bounds so
  other memory costs two loads, and for_each_part / run_end to split a range into table and host parts.
- xmem: g_table_frames under its own SRW lock (readers never wait behind g_phys_mutex), g_page_tables per physical
  page. A table page is aliased, its alias peers being its physical page's host views (note_mapping keeps them in
  step), so ProjectLeonida#1867's alias cells guard it where the title's CPU can write it. The title's unmap of a table page now
  tells its readers. transfer_physical pins and notifies table pages too.
- Readers: copy_guarded, texture_memory_readable, readable_page / readable_run_end (stream-pool extents),
  to_host_view, the ShadowPages walk and fill (a table page is read like a read-only page that is not the tracker's,
  clean while its cells are; a block with no host view anywhere is armed on its own cell), the geometry provider,
  the title buffers for vertex and index views, raw sampled surfaces, console value reads.
- Writers: kernel_writes::write and store write the frame and pin its peers; read_file reads into a bounce buffer
  first. DirectStorage goes through these.
- The slot-31 line keeps "pages N by table, M by host remap" and adds the paths behind them.

Not through the table: imports (a table page has no host pages; such buffers are shadows), GPU write-back into a
table page (left out like every aliased page; per-frame write-back is step 6), the LEONIDA_MAP_READBACK diagnostic,
the fsdraw and compute-input probes (host pages only), the batch hook's LEONIDA_SLOT31_CPU_TWIN mirror (not installed
in retail runs), and the title's own ReadFileEx/ReadFileScatter (the title has no CPU mapping there on the console).

Tests: title_frames_test (portable); xmem_test copy_page_mappings_cpu_view (no host view at either page, no host map,
reads and host writes through the frame, a write through the title's own mapping seen, remaps, kept twins, views
replaced once); d3d12_xmem_placed queue_remap_default_route (slot-133 buffers over the GPU-only pages and the twin read
them, a guarded title write through the pool's own mapping and a remap reach the GPU, no host remap).
Linux ctest (llvmpipe) 119/119; Wine suite on the iGPU against main e5a7c89: no pass-to-fail (432 pass, the same 23
failures).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…le, twins remapped by table (b54413e)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…again, and every fill keeps part hashes (RT-TITLE-TEXTURE-WRITE-TRACKED)

Run 60: 80 % of the looks were whole reads, 89 % of them unchanged. index_texture runs at every Map of a
slot-133 texture, at a layout found by a view and at a first naming, and each call re-tracked the texture:
its tiles were released and acquired again (so not armed) and it was named, so the next pass read it whole
although nothing had been written. Tracking again over the same tiles now changes nothing; a texture that
must be read (never filled, or known changed) is touched instead. Fills made outside the refresh (at a
slot-70 view, on the fill worker) now keep part hashes too, so the next written tile is decided by parts
rather than by a whole read. A line every 10 s counts whole reads by why: never filled, no part hashes,
one tile (its part is all of it), every tile written, no tile written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p; part hashes kept for view and worker fills (cadf432)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…draw that started and did not finish

With LEONIDA_DEVICE_MARKERS=1 every draw the replay records takes a seq from the dispatch numbering and writes the
VK_AMD_buffer_marker pair: started before its helper passes and rendering scope, finished after the scope ends (the
legacy indirect path inside the caller's scope, which the extension allows). The marker history (now 65,536 items)
keeps each draw's kind and counts, pipeline names, execute, list, command and its place among the draws to the same
targets. The loss and stall reports name the last finished item, the likely hang, the rest in flight and an idle
queue's next one not started, for draws and dispatches alike; a device-fault address is followed by the last draw
each queue started. Tests: the CPU marker test records draws and dispatches and checks the lines; the GPU marker
test writes draw markers outside and inside a dynamic-rendering scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… memory behind the number now (RT-MEMORY-MODEL)

Found by two world runs on the step-2 build (60, 61) that lost the device at the start of the 3D opening with a GPU
read of a garbage address, deterministic, where a run without step 2 (62) went past it.

map_table_page returned early when the table page already held the copy's page number. A number is not a page of
memory: XMemFreePhysicalPages puts the slot on g_free_slots and the next XMemAllocatePhysicalPages takes it back
first, naming a page of a new section. A stream pool's pages are freed and allocated again while the title keeps the
table entries, so the next copy of the same number left the table page on the freed page's frame (its entry holds
that section alive), and the readers of the GPU-only page and its CPU twin got the freed page's old bytes. Before
step 2 the twin was a host view, and map_page maps the number's current page every time, so the readers followed;
the GPU-only page had no readers.

The early return now also requires the frame the entry holds to be the number's current page (section and offset).

Test: xmem_test test_copy_page_mappings_reused_number: copy a page onto a paired GPU-only page, free it, allocate
again (the same number, asserted), map and fill it, copy again: the GPU-only page and its twin read the new page.
It failed before the change ("the table pages read the new page behind the number, not the freed one") and passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… guards as its protection (RT-TITLE-TEXTURE-WRITE-TRACKED)

Run 62 died on a write to a title page left read-only with no guard to answer for it ("stray read-only title
page ... no guard owns it"). TitleVirtualProtect passed the title's call straight through: over a page one of
our guards (a slot-133 shadow's, or a geometry-watch cell, which the title texture watch now arms over all
watched texture memory) had made read-only, the call returned that read-only protection in `old`, and its
Event::replaced made the cell forget the page. A title that saves `old` and sets it back later then made the
page read-only for good, with no owner, and its next write faulted.

The call now runs under a kernel-write pin over the range (kernel_writes::begin_write, as ReadFile does): our
guards come off first and no refresh puts one back until it returns, so `old` is the title's own protection.

Test: d3d12_xmem_placed's "title VirtualProtect over a guard" (an armed cell, the title's VirtualProtect to
read-write and back to what it reported, then a write); it fails without this (`old` is PAGE_READONLY).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… its range (6edfe23)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…73375f)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d allocation

title_memory_freed told shadow::write_combined_freed the call's own length,
and a release has none: write_combined_freed then dropped only the regions
that start exactly at the allocation's base. A region recorded for a commit
inside a reservation, or for one of the parts the title splits a placeholder
into (its 32-bit graphics heap comes in such parts, recorded GPU read-only),
outlived the release. Memory a later allocation got at those addresses then
counted as write-combined (LEONIDA_WC_NO_BACK, on in play-nvidia.ps1) or GPU
read-only (LEONIDA_GPU_READ_ONLY_NO_BACK, on by default), and what shaders
wrote there was left on the card instead of coming back to title memory.

On a release the extent is now the allocation's own (allocation_end, asked
before the memory is let go, as the views below already do). A decommit
keeps its length. write_combined_freed itself is unchanged.

The new test reserves memory, commits a write-combined part and a GPU
read-only part inside it, releases the reservation through
title_memory_freed and checks that neither region is left. It fails on main
with "a write-combined commit outlived its reservation".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zmasi and others added 20 commits November 30, 2026 04:22
… p2 narrow

Update `tests/semantic/test_interp_computed_ij_fallback.py` (ProjectLeonida#2239) to
narrow `v_interp_p2_f16` reference expectations toward zero (`f16_rtz` /
`f16_rtz_bits`), matching `SHADER-468` (ProjectLeonida#1181).

AI-assisted.
…rp-computed-ij-rtz-carry

test(semantic): align computed-I/J f16 interp oracle with toward-zero p2 narrow (TEST-INTERP-COMPUTED-IJ-FALLBACK-RTZ carry)
…_* 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>
…thon-cleanup

chore: remove 13 dead one-off scripts, fix /home/nolan test paths, drop unused imports (CHORE-TIER2A-PYTHON-CLEANUP)
…t storm, ShadowPages/TitleTextureCells guard conflict, and streaming budget bursts
…ix/rendering-correctness

# Conflicts:
#	tests/semantic/test_interp_computed_ij_fallback.py
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
progress_dashboard: reject non-JUnit XML reports (DASH-JUNIT-ROOT)
…-d3d12-run-fps

tools: frame rate of a D3D12-runtime run by draws a frame, and two runs side by side (TOOLS-D3D12-RUN-FPS)
docs: which imported GDK names have a public page (DOCS-GDK-PUBLIC-PAGES)
…orkers-win-venv

COMPUTE-WORKERS-WIN-VENV: launch Windows compute workers with sys._base_executable
tests/test_tool_stdout_encoding.py asks it of every tool. d3d12_run_fps.py came
in with ProjectLeonida#2594 without it, which left that test red on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f-cpu-gpu-r6

[integration] PageMirror, GPU detile, async queue & RDNA2->SPIR-V performance stack (INTEGRATION-PERF-CPU-GPU-R6)
…ring

docs: how to measure the D3D12 runtime's frame rates, and its LEONIDA_* variables (DOCS-D3D12-MEASURING)
@Kal0s-design

Copy link
Copy Markdown
Contributor Author

Merged main (d367675c7, all CI green there) into the branch so the red semantic-tests (the f16 case that was red on main too) runs again: new head 46399564b (merge commit, no rebase or force-push). cargo test -p leonida-gpu --lib on the new head: 564 passed, 52 ignored, 0 failed.

AI-assisted: yes

@KelboLive

Copy link
Copy Markdown

Independent check on Windows (not the author), at 46399564b.

  • cargo test --locked --jobs 8 -p leonida-gpu --lib -- --test-threads=8: 564 passed, 0 failed, 52 ignored in 13.8 s.

The diff adds no unit test (source-only in shadow.rs/watch.rs), so this is regression/compile coverage; the write-combined/GPU-read-only region release itself needs a game run, which I did not do.

Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Rust 1.98.1 pinned.

AI-assisted: yes (opencode).

@Kal0s-design

Copy link
Copy Markdown
Contributor Author

@KelboLive thanks for the Windows run. One correction for whoever reads it: the diff does add a unit test, shadow::tests::regions_inside_a_reservation_go_with_it (in shadow.rs, +32 lines). It fails on main and passes here, so it's red/green rather than only regression coverage: cargo test -p leonida-gpu --lib -- regions_inside_a_reservation_go_with_it.

AI-assisted: yes

@Kal0s-design

Copy link
Copy Markdown
Contributor Author

Closing as superseded: main now does this through f85d179 (#2795, D3D12-WC-SUBRANGE-NO-BACK, hardly-relevant). title_memory_freed with no length forgets the write-combined and GPU read-only regions over the whole allocation (resolve_end(...)), which is what this PR added. I checked it: this PR's test regions_inside_a_reservation_go_with_it, dropped unchanged into main 90c514437 (only .as_slice() added for the new SmallRanges), passes there. Thanks to the reviewers and verifiers.

AI-assisted: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.