Commit Graph

4696 Commits

Author SHA1 Message Date
b0f3d3998f Merge pull request #1631 from Tyrannys/title-window-overflow
d3d12: test that a view past the title-window cap is never the raw VA (RT-TITLE-WINDOW-OVERFLOW)
2026-11-25 15:52:34 +01:00
14f04ce2d2 d3d12: stage title textures when the image cannot take host copies
Select the upload path after checking both format features and image usage. Keep required staging available for mapped linear textures and only retry host backing when the image supports it. Exercise both capability failures with synthetic GPU readback.

AI-assisted-by: OpenAI Codex (gpt-6.2-astra)
2026-11-26 00:52:29 +10:00
d2158084cc Merge main into input-out-of-the-box: the input script row from #1843 with the keyboard pad on by default 2026-11-25 19:49:32 +05:00
daf31b820b replay: copies between depth formats that differ go through transfer scratch (RT-DEPTH-FORMAT-COPY-STAGED)
A CopyTextureRegion of the depth plane from a D32_SFLOAT_S8_UINT image into a
D32_SFLOAT one was replayed as vkCmdCopyImage. Vulkan requires depth/stencil
formats to match exactly (VUID-vkCmdCopyImage-srcImage-01548), and the NVIDIA
driver (RTX 4070 Laptop, 621.40) wrote past the end of the D32 image: the
world-start WRITE_INVALID device loss, with the fault at the first byte after a
2560x1440 D32_SFLOAT image (VK_EXT_device_address_binding_report) and this VUID
reported by the validation layer just before the loss.

depth_format_pair: two depth formats with the same depth encoding but not the
same VkFormat (D32 / D32S8, D16 / D16S8, X8_D24 / D24S8) take the image ->
scratch -> image path depth <-> colour and A8 copies already use; the depth
aspect has the same texel layout in a buffer on both sides.

replay_copy_offset_test: the D32S8 -> D32 and D32 -> D32S8 depth-plane copies
are staged (no vkCmdCopyImage, depth aspect, 4 bytes a texel), and D32 -> D32
keeps vkCmdCopyImage. Fails without the change (6 checks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:48:26 +01:00
45219a6400 d3d12 test: skip the write-back check when a refused import is a shadow
On a driver that refuses importing a section view (RADV: amdgpu userptr takes
anonymous memory only), the layer answers with a shadow at the same title VA,
so the `may_refuse` early return never fires. The forward readback still
passes through the shadow, but a shadow is never written back, so the new
reverse-copy check failed on an AMD iGPU under Wine. Check the caller's pages
only when the buffer is a real import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:44:19 -05:00
769634dd61 Merge main into fix/host-import-prefix 2026-11-25 09:40:21 -05:00
446574e761 Merge pull request #1785 from IlyassRS3/fix/rt-title-window-and-arena-bounds
runtime: harden title_window_plan and ArenaBlocks bounds/overflow checks (RT-TITLE-WINDOW-AND-ARENA-BOUNDS)
2026-11-25 15:40:05 +01:00
c3b58ef03d Merge pull request #1732 from kawaii-shakal/arena-rebar-cap
d3d12: keep a Resizable BAR arena in VRAM when the driver excludes it from a very large buffer (RT-ARENA-REBAR-FIT)
2026-11-25 15:38:52 +01:00
24a29f8b4e Merge pull request #1827 from DadaCap/title-staged-no-host-copy
d3d12: title images use the staged upload on a device without host image copies (RT-TITLE-STAGED-NO-HOST-COPY)
2026-11-25 15:37:56 +01:00
34ab89f896 tests: enable VK_EXT_transform_feedback in vk_pipeline_check (D3D-302)
The runtime's device enables VK_EXT_transform_feedback whenever the extension is present, and AMD's driver makes it part of a pipeline's cache key, so the cache vk_pipeline_check seeds offline no longer hit in gta6rt: pipeline_cache_seed failed 3/3 on an RX 7900 XT (adrianmjim). Link the same VkPhysicalDeviceTransformFeedbackFeaturesEXT the runtime enables, next to the mesh-shader one, and list it with the other always-enabled extensions in the header and docs/pipeline_check.md.

Tested: pipeline_cache_seed passes on an NVIDIA RTX 3080 Ti (NVIDIA does not key on the extension, so it cannot reproduce the AMD failure). AI-assisted.
2026-11-25 09:35:29 -05:00
9315a96edc d3d12_vulkan_device: detect and enable VK_EXT_transform_feedback
Foundation for D3D-302 (stream output): read the physical device's
transformFeedback/geometryStreams features where the extension is
present, record them on VulkanDeviceInfo, and enable them on the
logical device when supported, exactly the same pattern the existing
VK_EXT_mesh_shader detection/enable code already follows.

Device-capability plumbing only: no behaviour changes yet. A graphics
PSO declaring StreamOutput is still refused and SOSetTargets is still
not implemented, same as before this commit. Confirmed
VK_EXT_transform_feedback is available (4 streams, 4 buffers) on an
NVIDIA GeForce RTX 4070 SUPER, driver 621.24.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-25 09:35:28 -05:00
a0313920cc d3d12: the session pipeline cache is saved up to 4 GiB, checkpoints included (RT-SESSION-CACHE-LIMIT)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:27:11 +01:00
66b27ac6e2 lod_bias_probe: measure whether the sampler applies mipLodBias instead of keying --explicit-lod-bias on MoltenVK's driver ID (SHADER-EXPLICIT-LOD-BIAS-MVK)
The same MoltenVK 1.4.2 drops the bias on an Apple M3 and applies it on an
Apple M5 Pro (#1774 review), so the driver-ID rule turned ps_ssharp red on
the M5 Pro. tools/lod_bias_probe.py translates vs_ids and ps_ssharp without
the flag and draws LOD_BIAS 0, +1 and -1 with vk_sampler_test; the flag is
on only when +1 and -1 read the no-bias levels. run_gpu_tests.py, build.py
and make_game.py take its answer; vk_subgroup_info.py is back as on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:18:12 +01:00
aa8018b7ff d3d12: large pipelines compile side by side within a memory budget (RT-BIG-COMPUTE-BUDGET)
Compute modules over 128 KiB and graphics pipelines of 1 MiB of SPIR-V or more wait at one gate for the process until their estimates fit the memory that is free, instead of one at a time. PipelineCompiles::build gives a submission as many lanes for them as can be in at once, largest first, and fills the rest with small ones. A thread that waits for its place holds no PSO's lock, and one that has a place waits for none. The warm-up's compiles are speculative. LEONIDA_SERIAL_BIG_COMPILES=1 keeps one at a time, 0 has no limit, LEONIDA_BIG_COMPILE_BUDGET_MB fixes the budget.
2026-11-25 15:11:11 +01:00
4aa21d1a83 runtime: large compiles wait for memory in arrival order, demand before speculative (RT-BIG-COMPUTE-BUDGET)
LargeModuleGate moves to runtime/src (a forwarding header keeps vk_pipeline_check and its test as they are) and gets a second constructor, whose budget is read whenever a place is given or returned. Its modules get in in the order they came, a speculative one only while no demand waits and within a quarter of the budget. large_compile_budget_bytes() is three quarters of the smaller of the free RAM and the room under the commit limit. CPU test: the bound, one always, order, priority, every wake-up, the budget of the moment and the setting.
2026-11-25 15:11:10 +01:00
71a769d7d8 Merge pull request #1691 from OreoFR/rt-slot57-depth-raster
d3d12_xs: depth, stencil and raster state for slot 57 native pipelines from state blob A (RT-SLOT57-DEPTH-RASTER)
2026-11-25 14:55:52 +01:00
77baf90627 Merge pull request #1703 from OreoFR/rt-dual-source-blend
d3d12: dual-source blending reads SV_Target1 at Location 0, Index 1 (RT-DUAL-SOURCE-BLEND)
2026-11-25 14:46:46 +01:00
02d719cdac Merge main into title-window-overflow; keep only the window-cap test
Main's ba626820e already handles a title address past
LEONIDA_TITLE_WINDOWS_MB: the persistent geometry copy backs it, or
else every view writer emits a zero-size V# (loads 0, stores dropped),
so the raw VA never reaches the GPU (#1537). That replaces this branch's
zeroed scratch window, so the runtime and docs side take main's version.

The d3d12_title_window_cap test stays, rewritten for main's behaviour:
with a cap of 0, two CBVs of private title memory are written zero-size
(no base, no records, never the raw VA), no window is made, and a
dispatch through one reads zeros. Main had no test that dispatches
through an over-cap title address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:41:35 -06:00
5e95fa2f46 Merge pull request #1671 from OreoFR/rt-slot57-blend-state
d3d12_xs: blend state for slot 57 native pipelines from state blob A (RT-SLOT57-BLEND-STATE)
2026-11-25 14:28:49 +01:00
9a96b8ba6a gameinput: preserve controller transitions between polls 2026-11-25 13:25:48 +00:00
03096929f4 Merge main into first-run-pad-focus
Keep main's first-run profile without GPU completion labels and this
branch's focused keyboard pad (LEONIDA_KEYBOARD_PAD=1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:19:48 -06:00
857314142c Use the single Vulkan array layer for 3D image views 2026-11-25 16:17:47 +03:00
06c3b4a6ac RT-D24-CPU-ROUNDEVEN: Depth24 CPU conversions independent of the thread's rounding mode
depth24_quantize multiplied in float and rounded with std::nearbyint, and depth24_to_float divided in double and
narrowed to float; all three follow the calling thread's rounding mode, while depth24_convert.comp is roundEven of a
correctly rounded product and integer arithmetic. Under FE_DOWNWARD or FE_TOWARDZERO 0x1p-23f quantised to 1, not 2,
so CPU clears (vulkan_replay.h depth24_clear_value) could disagree with GPU uploads and copies.

No fesetround (a library must not change the caller's environment, and fenv access can be compiled out). No existing
helper fits (vulkan_replay.h's round_half_even is in a header that includes this one's users and rounds only once), so
depth24_detail::round_even is floor/fmod based like it: exact in every mode. The float product is formed exactly in a
double (24 x 24 bits), rounded to 24 significant bits by scaling with ldexp and round_even, then rounded to the
integer, which is the shader's two roundings. depth24_to_float uses the shader's integer formula,
float(m + 1) * 2^(e-47), every step exact.

depth24_cpu_test (no GPU, no Vulkan loader; same pattern as clear_color_test) runs the conversions under
FE_TONEAREST, FE_DOWNWARD, FE_UPWARD and FE_TOWARDZERO and compares with a float multiply + nearbyint reference run
under the default mode, with fixed cases (0x1p-23f -> 2, 0.5f -> 8388608 tie to even).

AI-assisted. Checked with g++ -std=c++20 -O2 (also -frounding-math, -ffast-math); not built with MSVC.
2026-11-25 13:16:42 +00:00
59c1586d4e d3d12: LEONIDA_HOST_IMAGE_COPY switch, auto off on NVIDIA
The layer enables VK_EXT_host_image_copy for WriteToSubresource and
ReadFromSubresource whenever the device has the extension and its
hostImageCopy feature. On an RTX 4070 SUPER (Windows 11) a real boot lost
the device with WRITE_INVALID in 7 of 7 runs that used host image copies
and in 0 of 2 that did not. The mechanism is not known yet.

LEONIDA_HOST_IMAGE_COPY chooses: 0 never, 1 whenever available, auto (the
default, also for unset or unrecognized text) as 1 except on NVIDIA
(vendorID 0x10DE), where it is off. Off, the extension is neither enabled
nor chained, so no image gets host-transfer usage and every CPU texture
copy takes the existing staging submit, as on a device without it.

The choice is a pure function (src/host_image_copy_policy.h) with a unit
test of its table, and device creation logs one line with the choice and
the reason in place of the old "no VK_EXT_host_image_copy" line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-25 08:07:27 -05:00
c90092b284 d3d12: changed console heap slots are fixed without a time limit by default, not given to shaders as null (RT-CONSOLE-FIX-BUDGET-NULL)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:05:05 +01:00
002c720f29 docs: preserve original statistics comment encoding 2026-11-25 14:01:35 +01:00
ca68cb7859 fix: stage texel-misaligned imported host texture copies 2026-11-25 14:01:35 +01:00
56846f650d tests: isolate host-prefix coherence and preserve full heap coverage 2026-11-25 14:01:35 +01:00
9de93fedd3 d3d12: retain fallback for byte-unaligned host buffers 2026-11-25 14:01:35 +01:00
3f81c4015b d3d12: preserve logical offsets in sub-page host imports 2026-11-25 14:01:35 +01:00
9428f57da2 runtime: share indirect clamp buffers across queue families and fix safety bugs
Pass device queue families into IndirectArgumentClamp and its ScratchBuffers so both clamped-argument scratch chunks and HostArea counter buffers are created with VK_SHARING_MODE_CONCURRENT when graphics and async-compute families differ (matching enable_copy_scratch).

Also fix four safety/correctness issues in runtime/src/vulkan_indirect_clamp.h:
- Free VkDeviceMemory before retrying the next memory type when vkBindBufferMemory fails in make_area(), and guard vector push_back against allocation failure.
- Zero released HostArea counter words after reading them so a later aborted/unsubmitted batch reusing the same slot never double-counts prior counters.
- Reject non-4-byte-aligned argument_offset and count_offset in prepare() (the compute clamp reads uint32 words via BDA).
- Read areas_[slot.area].buffer under mutex_ in prepare().

Item ID: RT-INDIRECT-CLAMP-SHARING-AND-SAFETY
Claim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162686562
2026-11-25 13:46:01 +01:00
ea6d535ff5 d3d12: title images use the staged upload on a device without host image copies (RT-TITLE-STAGED-NO-HOST-COPY)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 13:40:50 +01:00
c68f494160 RT-INPUT-SCRIPT-NO-SDL3: serve LEONIDA_INPUT_SCRIPT without SDL3
A build without SDL3 answered GameInputCreate with no devices and E_NOTIMPL
for every other slot, so the title waited at its first "press A" prompt
forever: no CI artifact or offline build could get past it.

With LEONIDA_INPUT_SCRIPT set, gameinput_no_sdl.cpp now serves one scripted
pad (an Xbox One gamepad) driven by the script alone: device enumeration
through RegisterDeviceCallback (blocking, async, dispatcher), FindDeviceFromId,
and GetCurrentReading/GetNextReading/GetPreviousReading whose gamepad and UI
navigation state follow the script. Readings are taken when the title asks,
so no thread polls. Without the variable it behaves as before.

The parser, the 300 ms timeline, the button names, the press log lines and
the UI navigation mapping move from gameinput.cpp into gameinput_script.h,
which both shims use; nothing in it needs SDL. gameinput.cpp checks the
shared SDL button numbers against SDL_GamepadButton at compile time.

gameinput_no_sdl_test --input-script (CTest gameinput_no_sdl_script) checks
the scripted pad on a fake clock. Docs: runtime/README.md, docs/gameinput.md,
docs/linux_proton.md, docs/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:39:13 -05:00
48ac7764b2 runtime: stop the configure when Vulkan headers are too old for the Windows runtime
Any vulkan/vulkan.h used to be accepted, so headers that are too old (conda-forge's
vulkan-headers resolves to 1.3.231 next to llvm-tools) configured fine and then failed
deep in the build: d3d12_com.h(42) "'calibrated': unknown override specifier" and 100+
errors in d3d12_vulkan_device.cpp, or VkPhysicalDevicePipelineBinaryFeaturesKHR in
vk_harness.cpp.

runtime/cmake/vulkan_headers_version.cmake reads VK_HEADER_VERSION from the headers
Vulkan::Headers points at (FetchContent's $<BUILD_INTERFACE:...> unwrapped) and fails
with the found and needed versions and how to fix it. The minimum, 294, is measured by
building the whole Windows runtime against Khronos header tags: v1.3.294 and SDK
1.4.304.0 build all 555 targets, SDK 1.3.280.0 all but vk_harness, 1.3.231 stops in the
D3D12 layer. Only Windows-runtime configures check, so the portable Linux/macOS tool
builds keep accepting older distribution headers.

tests/test_cmake_vulkan_headers_version.py runs the module with cmake -P on stub
headers and checks that the FetchContent and CI pins meet the minimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:35:41 +07:00
398c02fb34 docs: document LEONIDA_RNG_SEED in runtime/README.md
Commit 5d801afc1 added deterministic seeding mode to runtime/shims/bcrypt_rng.cpp
via LEONIDA_RNG_SEED, but the variable was not documented in any .md file.
As a result, tests/test_docs_env_vars.py failed on main:
  AssertionError: Lists differ: [('LEONIDA_RNG_SEED', 'runtime/shims/bcrypt_rng.cpp:80')] != []

Document LEONIDA_RNG_SEED in runtime/README.md under the Shims section for bcrypt.dll.

AI-assisted: yes.
2026-11-25 19:35:11 +07:00
94ba78348e d3d12_xs: slot caller via a formatter hook, cleared on reset (review of #9990)
- The proxy no longer calls rt::shims::module_offset itself: gta6rt sets it
  with set_device_slot_caller_formatter; with none set the address is shown
  in hex, so xs_proxy_mock_test links d3d12_xs_device.cpp alone as before.
- reset_device_proxy_stats() clears the stored caller with the first-call
  flag; xs_proxy_mock_test checks call -> caller -> reset -> empty -> call.
- The accessor comment says which slots it covers and that it is a
  diagnostic observation (flag set before the caller is stored).

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:33:54 -03:00
f1119e2906 d3d12_xs: the first call of a forwarded device slot names its caller (RT-526)
The first call of every Xbox device slot the proxy forwards by number now
logs the title code that made it as module+offset, and
device_slot_first_caller(slot) returns the same text. Finding a new
Xbox-only slot in the executable no longer needs a debugger.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:33:36 -03:00
703dfb493b runtime: fix PipelineWorkers stack use-after-free on OOM in start() (RT-PIPELINE-WORKERS-OOM-UAF) 2026-11-25 13:32:40 +01:00
eee02b7699 runtime: preserve dirty handoff in QueueHolds::pump_ready on exception 2026-11-25 13:28:33 +01:00
926e9d3ef3 D3D-CLEAR-UAV-3D-SLICE: clear selected 3D UAV slices and rectangles 2026-11-25 22:27:19 +10:00
ec2af135e3 Merge upstream main into d3d-sample-positions
Preserve indirect draw arguments and programmable sample positions in the same replay preparation path. Conflict resolution and Linux verification by Codex.
2026-11-25 12:24:00 +00:00
d33ada4344 runtime: fix test identifiers and preserve serial compile short-circuit
Address Windows MSVC / RX 7900 XT review findings on #1742:
- Qualify VulkanQueue::QueueKind::compute and ReplayResult::unresolved_resource
  in replay_pipeline_compile_unlock_test.cpp and replay_pipeline_compiles_test.cpp.
- Add PipelineCompiles::build_serial() / build_pipelines_serial() so the
  no-workers serial path still compiles outside resource_mutex_ while stopping
  at the first fatal refusal (preserving d3d12_pipeline_workers::refused_graphics
  serial expectations and avoiding wasted compiles after a failed draw).
- Add serial_stops_at_refused_draw() unit coverage in replay_pipeline_compiles_test.cpp.
2026-11-25 13:16:41 +01:00
5f549cf5f3 d3d12_vulkan: a title texture destroyed inside the registry is removed after the registry lets go
The last reference to a slot-70 texture can be a descriptor that write_placed_texture_view
overwrites while it holds title_texture_mutex: ~Resource then called title_texture_gone, which
took the same mutex again. MSVC's std::mutex throws resource_deadlock_would_occur there, and
Wine's msvcp140 has no _Throw_Cpp_error, so the boot aborted (stack: proxy_create_placed_view_x
< write_placed_texture_view < write_title_srv < CreateShaderResourceView < ~Resource). Inside
the registry the entry now only stops naming the resource, and drain_titles_gone removes it and
its GPU placement once the thread has released the mutex.
2026-11-25 13:16:04 +01:00
3ab657b058 runtime: unlock resource_mutex while compiling unbuilt pipelines 2026-11-25 13:15:02 +01:00
0267290f9c runtime: preserve in-flight GPU label targets when expanding a non-heap region
In runtime/src/gpu_label_memory.h, Memory::track() previously returned early
when the new range lay within an existing non-heap region, but fell through
to overwrite regions_[base] with a fresh std::shared_ptr<Region> whenever an
existing non-heap region at the same base and allocation_base grew (end >
r.end). Overwriting the shared_ptr invalidated every in-flight label::Target
captured from that region, causing publish() to silently drop GPU completion
value writes.

Update r.end in place when base == r.begin with the same non-heap
allocation_base so live targets retain their Region identity and generation
(while preserving stale-target rejection across partial releases, separate
tracking of adjacent pages, and fresh Region replacement for heap blocks or
new reservations).

Add portable unit and TSan concurrency test runtime/test/gpu_label_memory_test.cpp.

Item: RT-GPU-LABEL-MEMORY-EXPAND
2026-11-25 13:11:24 +01:00
eb4c4204e8 runtime: harden title_window_plan and ArenaBlocks boundary and overflow checks
Fix edge-case arithmetic and boundary bugs in the title-memory window
planner and GPU address arena allocator:

1. runtime/src/title_window_plan.h:
   - title_window_range(): reject va < lo (previously returned a range
     starting at lo > va that excluded va, causing va - range.start to
     underflow in resolve_title_memory), reject most == 0 (avoiding
     std::clamp(want, 1, 0) UB), require power-of-two align, and avoid
     UINT64_MAX - want - align unsigned underflow when computing end.
   - title_pool_extent(): reject non-power-of-two align and unreadable
     requests (readable_end <= va) before rounding end up to align, and
     enforce the most cap after alignment rounding so out.size <= most
     always holds and out contains va.
2. runtime/src/arena_blocks.h:
   - Make align_up() overflow-checked so high alignments or keep_out_end
     near UINT64_MAX cannot wrap to 0 and trigger an infinite loop in
     ArenaBlocks::allocate().
   - Guard against non-advancing keep_out_end <= start in allocate().
   - Make consistent() safe against reserved_ > size_ underflow and
     free_bytes_ + live_bytes overflow.

Extend runtime/test/arena_blocks_test.cpp and add portable
runtime/test/title_window_plan_bounds_test.cpp.

Item: RT-TITLE-WINDOW-AND-ARENA-BOUNDS
2026-11-25 13:09:51 +01:00
3e6e229a64 runtime: make QueueHolds pump handoff race-free, exception-safe, and per-instance
Fix three bugs in runtime/src/queue_holds.h (the cross-queue Wait-before-Signal
and Present barrier scheduler):

1. Lost-wakeup handoff race in pump_ready(): previously a thread exiting
   pump_ready() called pump.unlock() (release) followed by dirty_.load(acquire),
   while a concurrent caller wrote dirty_.store(true, release) followed by a
   failing pump_mutex_.try_lock(). Under the C++ memory model and on weak
   architectures (ARM64), a release followed by an acquire does not prevent
   Store-Load reordering, allowing both threads to exit with dirty_ == true
   and ready batches/presents stuck indefinitely. Serialize dirty_ and
   pump_active_ transitions under the leaf mutex_ (preserving strict
   pump_mutex_ -> mutex_ lock ordering).
2. Exception-safety deadlock: in_pump() was toggled manually around
   discard_waiting_on(), release_ready(), and run_barriers(); any exception
   left in_pump() permanently true on that thread, silently suppressing every
   future pump_ready() and remove_fence(). Use an RAII PumpScope and
   ActiveGuard so state always unwinds cleanly.
3. Cross-instance collision: in_pump() used a single process-wide
   thread_local bool shared across all QueueHolds instances, causing a nested
   pump_ready()/remove_fence() on a second instance to be skipped. Track
   re-entrancy per instance with a stack-allocated intrusive PumpScope chain.

Add portable unit and concurrency stress suite runtime/test/queue_holds_test.cpp.

Item: RT-QUEUE-HOLDS-PUMP-SAFETY
2026-11-25 13:04:22 +01:00
b19b00e88a Merge branch 'rt-slot57-blend-state' into rt-dual-source-blend
# Conflicts:
#	docs/fspx.md
2026-11-25 13:01:26 +01:00
7a769396d9 Merge branch 'rt-slot57-blend-state' into rt-slot57-depth-raster
# Conflicts:
#	runtime/CMakeLists.txt
2026-11-25 13:01:25 +01:00
668d65b4b9 d3d12_xs: slot 57 retries only a pipeline that blends a B4G4R4A4 stand-in (RT-SLOT57-BLEND-STATE review)
adrianmjim's review: the blend fallback ran on any E_NOTIMPL, which also stands for
refusals unrelated to blending (stream_unsupported, mesh limits, FullyCovered, and
#1703's dual-source refusal). Such a pipeline was retried with blending off, logged as
a blend refusal, and, if the retry succeeded, drew without the blend the title asked for.

Now only a pipeline with a blended B4G4R4A4 target is retried, with blending off on
those targets alone (without_stand_in_blend, its own header), and the line is printed
only when that retry succeeds. The "every target" step is gone: no real boot used it
(RTX 4070 Laptop and kawaii-shakal's RTX 5070 Ti only ever logged the B4G4R4A4 step).
native_pso_fallback_test covers the decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 13:00:57 +01:00