<feed xmlns='http://www.w3.org/2005/Atom'>
<title>npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/runtime/shims/xmem.cpp, branch ci/exclude-legacy-cpp-runtime-tests</title>
<subtitle>[no description]</subtitle>
<id>https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=ci%2Fexclude-legacy-cpp-runtime-tests</id>
<link rel='self' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=ci%2Fexclude-legacy-cpp-runtime-tests'/>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/'/>
<updated>2026-11-30T09:34:17+00:00</updated>
<entry>
<title>runtime: eliminate Windows 11 full-space commit_pages_locked broadcast storm, ShadowPages/TitleTextureCells guard conflict, and streaming budget bursts</title>
<updated>2026-11-30T09:34:17+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-30T09:34:17+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=efc1929908a728d95fa09ffef0a743d2a649b86d'/>
<id>urn:sha1:efc1929908a728d95fa09ffef0a743d2a649b86d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>runtime: fix present_mutex AB-BA deadlock, cross-queue relay cycle, and held-queue stalls</title>
<updated>2026-11-30T02:05:26+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-30T02:05:26+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=1aefed0dacd492a040909c9a423f270ebdab84f4'/>
<id>urn:sha1:1aefed0dacd492a040909c9a423f270ebdab84f4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>runtime: Round 10b WS-B/C/D — feed_seq coalescer guard, map_view TOCTOU removal, bridged rollback gap preservation, RO VQ exclusion &amp; bindless dim2D/multi-key fixes</title>
<updated>2026-11-28T11:29:45+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-28T11:29:45+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=89b7b344f401701fd7d1b9f2204f1f94ed557b2e'/>
<id>urn:sha1:89b7b344f401701fd7d1b9f2204f1f94ed557b2e</id>
<content type='text'>
AI-assisted: Antigravity (Gemini 4 Neon).
</content>
</entry>
<entry>
<title>runtime: Round 10 WS2 — shared Cell::known_* cache, TitleHeap changed() scoping, 64-tile bridging, fused AVX2 copy_and_sum_256 &amp; filter/collect cuts</title>
<updated>2026-11-28T10:38:11+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-28T10:38:11+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=70ea06a50bc5323359492c34861b48a8d3c96db2'/>
<id>urn:sha1:70ea06a50bc5323359492c34861b48a8d3c96db2</id>
<content type='text'>
- Move title_memory_map::changed() into TitleHeap::hooks.commit/decommit and !from_mirror_heap in free_title_block()
- Share Cell::known_* across CellGuard &amp; TitleTextureCells (no PAGE_READONLY no-guard cache; MEM_RESERVE intra-pass in TitleTextureCells, cross-pass in CellGuard; seed on xmem::map_view)
- Persist TitleTextureCells VQ cache across outer batches; bridge across run_already_armed_ tiles with uniform restore[0..15] up to kMaxBridgeGap=64
- Persist 1024-entry local_mirror per ConsoleHeap*, flush Phase A/B disjointly, handle !base V#s in Phase A, skip redundant WC BAR writes for waiting T#s
- Fused SEH-safe AVX2/SSE2 guarded::copy_and_sum_256(), kMaxWorkers=8, single-reader title_write_watch::ask() fast path preserving mark() entries

AI-assisted: Antigravity (Gemini 4 Neon).
</content>
</entry>
<entry>
<title>runtime: Round 9 WS2 — read+back cache/coalescing, single-lock title_frames, TitleTextureCells gap-bridging, 8 MiB pool &amp; 3D linear mips</title>
<updated>2026-11-28T09:42:02+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-28T09:42:02+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=09f8cb66bfca1d3de7539287ccdbff631c32bdcd'/>
<id>urn:sha1:09f8cb66bfca1d3de7539287ccdbff631c32bdcd</id>
<content type='text'>
- Separate title_texel_writes from title_map_changes_ (retry t.memory only when pending/filled_from/!fills) and coalesce title_texel_writes::note() up to 16,384 spans before overflow
- Enable cache_success=guard + sync_map() for t.mapped while keeping cache_failure=guard&amp;&amp;!mapped
- Single-lock zero-shared_ptr title_frames::run_end &amp; backed_batch hooks + Stage-2 TextureVqCache
- TitleTextureCells::arm_batch(): range_clean_since() at all 3 sites, kMaxBridgeGap=8 pin-guarded bridging, c-&gt;armed_map_gen, batched sync_tile_peers()
- Raise TitleImagePool::largest_slot to 8 MiB (16 MiB page cap), pool non-RT/non-DS deferred textures, best-fit TitleImageUpload::take_slot(), 16 MiB job.tiled retention, linear 3D mips&gt;1, readable/back/arm/cpu_fallback_by[6] telemetry

AI-assisted: Antigravity (Gemini 4 Neon).
</content>
</entry>
<entry>
<title>runtime: Round 8 WS3 — fix list-value gate TOCTOU, offload QueueHolds barriers, empty-batch/wait coalescing, replay floor &amp; batched xmem slot-31</title>
<updated>2026-11-28T08:31:06+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-28T08:31:06+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=59db4b62b039cec2121409c60be670514020e90a'/>
<id>urn:sha1:59db4b62b039cec2121409c60be670514020e90a</id>
<content type='text'>
- Fix Pump::choose_release() TOCTOU on already-completed unlanded write groups/action gates + 10 ms quiet window on Reason::present
- Skip before_execute/visibility_seq on empty batches (preserving pending_wait_vis_seq_), coalesce past GPU-completed Waits (merging CPU vis_seq), cache CommandList summary, atomic unbuilt_sync_pipelines_ &amp; BindlessSet clean fast-paths, hoist EmitScratch
- Dedicated QueueHolds barrier-drain thread with active_work_ tracking, wait_barriers_drained() ordering, cancel_after() wait, and non-blocking VulkanQueue::release_ready()
- Batch copy_page_mappings() per contiguous range &amp; notify Event::replaced on mirror_heap decommit in xmem.cpp
- SEH-guarded aligned volatile read_value() (no noexcept under /EHsc) + 1000 ms slot-12 Vulkan fence mirror timeout

AI-assisted: Antigravity (Gemini 4 Neon).
</content>
</entry>
<entry>
<title>runtime: parallel Phase-A heap filter, single-lock unwatch, fault VirtualQuery skip, and 64 MiB copy-queue readback</title>
<updated>2026-11-28T07:08:11+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-28T07:08:11+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=aff99e069a7694ec51e775d0eb6c00fc32805288'/>
<id>urn:sha1:aff99e069a7694ec51e775d0eb6c00fc32805288</id>
<content type='text'>
Cuts PageMirror refresh, write-fault, unwatch, and GPU write-back overhead:
- d3d12_vulkan_device.cpp / title_mirror.h / console_heap_slot_records.h: hoists 1024-entry FilterPageCache across upload(), buffers filtered slots in 64 KiB host scratch with coalesced WC BAR flushes, parallelizes pure read-only Phase A heap filtering across WorkerPool with sequential Phase B under page_mirror.mutex, and adds none-&gt;none / idempotent place() fast paths.
- title_mirror_hot_cold.h / title_geometry_watch.h / xmem.cpp: fixes HotColdTracking::unwatch() triple-lock/bogus-WriteQueue bug with single-lock geometry_writes::release(addr, was_hot), skips redundant 2nd VirtualQuery in notify(Event::fault), and passes ranged changed(start, end) from xmem.cpp.
- d3d12_vulkan_device.cpp / title_mirror.h: raises kReadbackPages to 1024 (64 MiB), routes readback copies onto info.copy_queues, bypasses kernel_writes::write() on xmem scratch frames (frame != page_va), batches begin_write/end_write per ordinary page, and lowers whole_title_ok threshold to 2.

AI-assisted: Antigravity (Gemini 4 Neon).
</content>
</entry>
<entry>
<title>runtime: restore kPromote=6/8, drop frame_hot over-copying, and wire region-batched MEM_WRITE_WATCH</title>
<updated>2026-11-27T16:44:26+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-27T16:31:36+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=4442c5b64601d8d461b74a383347d03087c211f1'/>
<id>urn:sha1:4442c5b64601d8d461b74a383347d03087c211f1</id>
<content type='text'>
- TitleWritePolicy (runtime/src/title_write_policy.h): restore kPromote = 6
  (of kHistory = 8) and cleanly remove the frame_hot / present_frame() tier
  and its dead fields/counters so 1/frame pages never trigger per-submission
  over-copying or copies on empty submissions. Keep O(dirty + hot + recent)
  active lists and sorted Guard::arm_batch() batching.
- HotColdTracking (runtime/src/title_mirror_hot_cold.h) &amp; d3d12_vulkan_device.cpp:
  remove the dead on_present() / last_present_serial hook (coordinated with
  gate-async-fixer) and unused write_watched_* getters, and cache
  region-batched MEM_WRITE_WATCH runs (bridging verified MEM_COMMIT gaps &lt;=
  1 MiB, capped at 64 MiB per GetWriteWatch call, never bridging uncommitted
  holes, with O(1) unordered_set dirty filtering and conservative dirty
  recording + split-retry on mid-run refusal so no journaled write is lost)
  so steady-state collect() runs in O(regions + dirty) without walking
  ww_pages_.
- TitleHeap (runtime/src/title_heap.h) &amp; xmem.cpp: upgrade for_each_committed()
  to emit maximal coalesced committed extents (exact complement of free_runs_,
  O(free_runs_.size()) instead of scanning all 32k span slots, never spanning
  uncommitted holes) and wire MEM_WRITE_WATCH with silent MEM_RESERVE fallback
  + title_write_watch registration/marks in mirror_heap_ready() (never
  combined with MEM_LARGE_PAGES, MEM_PHYSICAL, or section views).
- Tests: update title_write_policy_test.cpp (kPromote = 6/8 and zero copies
  of 1/frame pages on empty submissions) and title_heap_test.cpp (coalesced
  for_each_committed() tracking around decommitted holes).

AI-assisted: Antigravity, Gemini 4 Neon
</content>
</entry>
<entry>
<title>page mirror: the XMemAlloc heap in the mirror's range; pages written on both sides merged at the 256-byte piece (RT-PAGE-MIRROR)</title>
<updated>2026-11-27T11:18:52+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-27T11:18:52+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=5cf7f8988682c4a7fae9b6f24498e5722ffed730'/>
<id>urn:sha1:5cf7f8988682c4a7fae9b6f24498e5722ffed730</id>
<content type='text'>
The XMemAlloc heap (src/title_heap.h) is the runtime's own over a 32 GiB reservation that xmem places in the
mirror's range. It does not use RtlCreateHeap over a given base, which faults under Wine. Size classes of 64 bytes up
to 1 KiB, then powers of two up to 32 KiB, in 1 MiB spans. Larger blocks are runs of 64 KiB pages, committed when
handed out and decommitted when freed. Freed blocks are kept on lists outside the title's memory, and one lock covers
every call. Committed pages are fed to the mirror as they are committed, so a pointer the title writes into a block
reads the block's bytes without anything naming the range first. The title sees the same as before: 64-byte
alignment, size 0 as 1 byte, and XMemFree of a block from either entry point. When the range is full, blocks come
from the host's heap as before. With LEONIDA_TITLE_HEAP=0 they come from the CRT.

Pages written on both sides: each home keeps a 64-bit sum per 256-byte piece of what both sides last agreed on.
- An upload copies only the pieces the title changed, so a piece only the GPU wrote keeps the GPU's bytes.
- Write-back copies only the pieces the GPU changed while the title's piece still matches the sum.
- A piece both sides changed keeps the title's bytes and is counted.
The mirror's 10 s line gives uploaded and written-back KiB per submission and per frame, and the count of pieces
written on both sides.

Tests:
- title_heap: classes, large blocks, and 20000 random allocations and frees checked against a reference.
- d3d12_page_mirror part 7: one page, the GPU writes piece A and the title piece B in one window, and both survive.
- d3d12_page_mirror part 8: the GPU reads XMemAlloc blocks through pointers nothing named, and a freed large block
  reads zero.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>d3d12: slot-133 buffers, title windows and pool extents onto the page mirror; GPU writes into mirrored pages go back; hot/cold tracking; homes by budget (RT-PAGE-MIRROR)</title>
<updated>2026-11-27T10:56:53+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-27T10:56:53+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=0cdc80d2075a7e22f24c76f4a9cfe6c0ae72f08a'/>
<id>urn:sha1:0cdc80d2075a7e22f24c76f4a9cfe6c0ae72f08a</id>
<content type='text'>
Step C, with the previous WIP commit.
- Resource::create_mirror_buffer: a slot-133 buffer over title memory the mirror holds in one chunk is bound to that
  chunk at heap_base + its title address: no import, no shadow, no per-submission walk or guard of its own. Its GPU VA
  is the title address; V#s and root views naming it keep that address. Title windows and stream-pool extents are not
  made for mirrored memory (resolve_title_memory answers the mirror first, since step B).
- Write-back (DeviceState::page_mirror_write_back, from write_back_titles after the reaching submission retired): the
  256-byte pieces whose home differs from the title's page are written back through kernel_writes, on pages nothing
  wrote since they were last armed (TitleMirrorTracking::unwritten); a page written on both sides keeps the title's
  bytes, which are uploaded over the home before the next submission. Ranges are noted (note_title_write, with its
  caps) where a V#, a writable geometry range, a title-memory resolution or a BVH range is answered by the mirror.
- The mirror's tracking is HotColdTracking (src/title_mirror_hot_cold.h); it now answers unwritten() for cold pages
  from the version its guard was armed at (an additive change to that file and to the interface, default false).
- Homes go to device-local memory while VK_EXT_memory_budget keeps 1.5 GiB (or an eighth of the budget) for the
  title's textures and render targets after a unit, to host memory otherwise, decided per 32 MiB unit and logged when
  it switches; the mirror's line and the mem-probe item count units of each kind.
- The mirror's line adds hot and cold pages, write faults, hot and cold copies, and KiB uploaded a submission and a
  frame.

Not moved: the XMemAlloc heap (HeapCreate places it). RtlCreateHeap over a reservation in the mirror's range faults
under Wine (it writes the reserved base), so it stays outside the mirror; slot-133 buffers there keep their shadows.

Tests: d3d12_page_mirror_test (Wine, iGPU): a slot-133 buffer over mirrored memory has the title's address as its GPU
VA and is no shadow; a GPU write into its home goes back to the title's page (one 256-byte piece), a page written on
both sides keeps the title's write. Linux ctest (llvmpipe) 122/122; xmem_test OK.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
