- Move title_memory_map::changed() into TitleHeap::hooks.commit/decommit and !from_mirror_heap in free_title_block()
- Share Cell::known_* across CellGuard & 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).
Two distinct deferred shared-BC slot-133 placements share a placeholder VkImage
until promoted; keying non-title-heap ViewKeys by image.address gives each
resource its own bindless slot while preserving full title-heap ViewKey dedup.
AI-assisted: Antigravity (Gemini 4 Neon).
- Zero ResourceDesc padding words [1,2,3,13], compare non-format words + compatible formats in title_texture_matches(), preserve layout-equal slot-133 textures & mirror_hash_valid on unmap
- Guard refresh_title_texture() touch() against unreadable pending_stream textures while preserving deferred backing & publish_streamed_texture
- Zero-syscall already-armed Cell::restore[] check + table-page backed skip + PAGE_READONLY region cache in TitleTextureCells::arm_batch(); sync_tile_peers() skip in examine_batch()
- Snapshot geometry_writes serial before refresh_page_mirror() to skip redundant page_mirror_check_batch() dirtying on both CPU and GPU views; parallelize Pass 3 range_sum() >= 8 MiB
- Decouple GPU-mirror batching (512 jobs / 128 MiB) from CPU 64-slot limit, single-call vkAllocateDescriptorSets per sub-batch, kMaxScratchSlots=64, 4-part examine_ns telemetry
AI-assisted: Antigravity (Gemini 4 Neon).
Calls publish_streamed_texture(from) after back_title_texture() in refresh_title_texture() so deferred pending_stream slot-70 descriptors immediately bind their views when pages arrive while texel upload remains deferred to batched refresh_title_textures().
AI-assisted: Antigravity (Gemini 4 Neon).
Preserves immediate bindless descriptor indexing for pending_stream slot-70 textures once their pages become readable (fixing d3d12_existing_heap slot-70 view map changes test) while still deferring texel uploads to batched refresh_title_textures().
AI-assisted: Antigravity (Gemini 4 Neon).
Fixes two clang-cl compile errors in d3d12_vulkan_device.cpp after hoisting FilterPageCache into FilterCacheScope.
AI-assisted: Antigravity (Gemini 4 Neon).
Renames PageMirror's Phase-1 WorkerPool to readback_hash_pool (avoiding collision with VkCommandPool readback_pool) and replaces invalid (std::max)<std::uint64_t>(...) with (std::max)(std::uint64_t(1), ...) for clang-cl/MSVC.
AI-assisted: Antigravity (Gemini 4 Neon).
Routes page_mirror_check_batch() uploads through note_readback_pieces_uploaded_locked() and console-heap page invalidations through note_readback_frame_invalidated_locked() so unrelated pages never poison readback_invalidated; renames a shadowed parameter in title_texture_watch_test.
AI-assisted: Antigravity (Gemini 4 Neon).
Eliminates false CPU-staged re-uploads, per-texture page_mirror.mutex churn, and unbatched tile re-arming:
- d3d12_vulkan_device.cpp: replaces per-texture page_mirror_texture_chunk/page_mirror_tiles_unchanged with a single-lock page_mirror_check_batch() snapshotting pending xmem remaps under shared feed_lock (rejecting only overlapping textures) and running one batched parallel TitleMirror::upload(); adds TitleJob::previous_mirror_hash check in hash_title_job() so GPU-uploaded textures falling back to CPU skip unchanged re-uploads; separates lock_wait_ns from collect_ns.
- title_texture_watch.h / title_texture_refresh.h: adds examine_batch() + TitleTextureCells::arm_batch() coalescing pins and contiguous VirtualProtect runs, uses direct Tile*/Texture* pointers in watch indices, and merges write/map ranges before iteration.
AI-assisted: Antigravity (Gemini 4 Neon).
Eliminates the async readback page_mirror.mutex convoy and serial fallback, and reduces page-mirror refresh cost:
- title_mirror.h / d3d12_vulkan_device.cpp: lifts WorkerPool for lock-free Phase 1 prehash_readback_slice() outside page_mirror.mutex and single-call Phase 2 write_back_prehashed() under lock (256-page slice: 0.11 ms unlocked, 0.03 ms locked), eliminating the 256x serial single-page fallback and merge_ranges() storm.
- Scopes readback invalidation to readback_slice_frames with per-frame 256-bit readback_slice_skip_masks populated from TitleMirror::upload(on_changed), preventing hot-page retry loops while preserving CPU-wins conflict semantics.
- Coalesces contiguous GPU write-back runs, batches deferred map() initial fills in parallel upload(), and replaces fed_now unordered_set with a flat sorted vector.
- title_mirror_hot_cold.h: consolidates CellGuard maps into a single TrackedCell map and adds a changes_since()-invalidated known_protect cache to halve cold re-arm VirtualQuery syscalls.
AI-assisted: Antigravity (Gemini 4 Neon).
Removes UnalignedWord64, mix_words, hash_bytes, hash_guarded, and hashed_bytes from d3d12_vulkan_device.cpp after CPU texture hashing moved to copy_guarded + mirror_range_sum_bytes().
AI-assisted: Antigravity (Gemini 4 Neon).
Enables /arch:AVX2 on x64 MSVC/clang-cl and -march=x86-64-v3 on x86-64 GCC/Clang for C/C++ targets (activating AVX2 shadow_keep::sum_of, descriptor-slot scans, and auto-vectorization while keeping non-x86-64 portable builds untouched), and removes an unused local clock typedef in page_mirror_write_back_ranges.
AI-assisted: Antigravity (Gemini 4 Neon).
Cuts per-submission texture refresh overhead and prevents passive write-back accumulation across overlapping queues:
- title_texture_refresh.h: adds shadow_keep::sum_of-backed mirror_range_sum helpers and PassiveWriteBackTracker with retire_id watermarking so overlapping direct/compute queues promote each passive V# range without re-promoting stale ranges indefinitely.
- title_texture_watch.h: skips hot_tiles() rescans when hot_generation() is unchanged and tracks non_hot_arms to reuse synced shared hot tiles per pass.
- d3d12_title_image_upload.h: reuses detile scratch buffers across sub-batches and skips detile setup when unused.
- d3d12_vulkan_device.cpp: extends TitleMirror range_sum() skip to all 256B-aligned and partially mirrored textures, filters dirty chunk syncs by title_written_ (guarded by !t.stale), caches can_gpu_upload(), pools TitleJob buffers, runs inline single-item reads/hashes, and defers t.pieces commits until upload success.
AI-assisted: Antigravity (Gemini 4 Neon).
Promoting 1x/frame pages to unguarded hot caused HotColdTracking to copy
~5,000+ pages on every submission (~50 GiB/10 s) and dirtied all textures
sharing those tiles (~119 ms/sub). Restore the submission-hot (6/8)
policy where unguarded copies beat fault+copy cost, and accumulate actual
CPU+wait time in AsyncReadback::cpu_ms instead of async wall-clock span.
AI-assisted: Antigravity (Gemini 4 Neon).
Retain staging for shared BC images on devices without host copies and keep the per-image fallback for formats without usable host-transfer backing.
AI-assisted-by: OpenAI Codex (GPT-6)
Cache bound pipelines, descriptor sets, dynamic graphics state, and dirty
push-constant sub-ranges across command lists in emit_commands() (with
invalidation across internal compute helpers and rendering boundaries),
and restore the two-tier submission-hot + presented-frame-hot policy in
TitleWritePolicy/HotColdTracking wired to present_serial.
AI-assisted: Antigravity (Gemini 4 Neon).
Guard GeometryViews retirement with command_list_epochs, defer TitleMirror
freed-home ticket stamping until flush + note_mirror_bind under submit_mutex_
(including TitleImageUpload submits), fix queue lock ordering and lock-free
wait_submitted, remove dead helpers and process labels, and scrub game shader
identifiers from docs/design.md.
AI-assisted: Antigravity (Gemini 4 Neon).
create_address_guard() made the page table that shaders translated with
--address-guard read through its device address with
VK_SHARING_MODE_EXCLUSIVE, though those shaders run on the direct and
the async-compute queue. The other buffers every queue reads are shared
by the device's queue families (DeviceState::share).
The create info now comes from address_guard::table_buffer_info(), which
shares it the same way (concurrent on two or more families, exclusive on
one), with a CPU test.
Found by kevincommits (#1608).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>