quantize_unorm/quantize_snorm used std::nearbyint, which follows the thread's
rounding mode (matheuskshn's review): under FE_DOWNWARD 0.5 on 8 bits gave 127
and 0.5 on SNORM8 gave 63. round_half_even uses floor() plus an explicit tie
check, which does not depend on the mode. clear_color_test converts the ties
under FE_DOWNWARD, FE_UPWARD and FE_TOWARDZERO and checks them once the
default mode is back; with nearbyint it fails as above.
d3d12_clear was left out of ctest until this lands (3fc0b21); it is registered
again, with SKIP_RETURN_CODE 77 as before.
- render_target_clear_color: main's integer conversion (every exposed UINT/SINT
format, A2B10G10R10_UINT's 2-bit alpha) with this branch's normalised
rounding (quantize_unorm, quantize_snorm) for the UNORM, SNORM and sRGB-alpha
channels.
- Depth clears: main's D24-as-float conversion, then D16_UNORM through
quantize_unorm.
- Format tables: main and this branch both mapped DXGI R16_UNORM and R8G8_SNORM
and the R8G8_SNORM copy size; the duplicates are dropped.
- clear_color_test: main's table-driven integer checks plus this branch's
normalised and integer cases. The float pass-through loop now uses
R32_SFLOAT and R16G16B16A16_SFLOAT, since R8G8B8A8_UNORM values are rounded.
Without llvm-mc, run_gpu_tests.py, valu_fuzz.py, lds_fuzz.py,
image_fuzz.py, crosslane_fuzz.py and runtime/test/shaders/build.py
ended in 'FileNotFoundError: [WinError 2]' from subprocess.run: the first
step of TEST-71 on a Windows machine without one. Only shader_disasm.py
said what was missing. mc_command.run() starts an llvm-mc command and
turns a command that can't be started into shader_disasm.py's message
(set LLVM_MC or --llvm-mc, build_llvm_mc.ps1, the WSL form); the six
llvm-mc call sites use it. tests/test_mc_command.py covers run() and
each tool with a nonexistent LLVM_MC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Intel UHD 770 reports maximum depth for NaNs in the float comparison path. Check the input encoding before rounding finite values and exercise both signs of every NaN payload on the GPU.
Python's maximum can ignore a NaN after a finite operand. Check every decoded result before reducing pixel errors so a broken high-half export cannot pass both GPU runners.
- register_samplers (main) and create_window_presenter (stack) both kept.
- Resource dtor: stack arena release + main deferred destroys.
- AS binding: main size/host_readable + stack console va.
- VulkanContext: main's lock split kept; stack arena/pipeline accessors
moved to resource_mutex_ (execute copies replay_ under its shared lock),
presenter lookups take it shared.
- README takes main wholesale; D3D-90 code and tests untouched.
Resolved along the lines in #291 (comment by ItsNotRexed, 2026-11-22 08:27):
- Default-heap buffers stay in the GPU address arena: a VA is an arena offset,
and every buffer's device address is heap_base + VA (upload and readback
buffers: device address minus heap_base, as before).
- Acceleration structures: a buffer created in RAYTRACING_ACCELERATION_STRUCTURE
state on a ray-tracing device stays out of the arena and keeps main's model,
its VA being the VkAccelerationStructureKHR's device address, so BLAS
addresses in TLAS instance descriptions are what Vulkan reads. It is
registered by that VA. BuildRaytracingAccelerationStructure turns build
inputs and scratch into heap_base + VA, and the arena gets the build-input
usage on ray-tracing devices. Resource keeps one va_ (gpu_va_/buffer_va_
removed).
- buffer_at keeps the size& signature; main's only caller (WriteBufferImmediate)
is the branch's version, and ExecuteIndirect resolves its buffers by id.
- ~Resource keeps arena_release and main's defer_destroy.
- Main's split context locks: pipeline registration and heap_base/zero page
take resource_mutex_ (prepare looks pipelines up under its shared lock);
VulkanPresenter takes resource_mutex_ shared, plus tracker_mutex_ while it
records the back buffer's transition.
- Standalone device: main's single instance-extension list and DXGI swapchain
enable; info.presentation follows the same swapchain/surface condition, so
create_window_presenter keeps working. Main's DeferredDeletionQueue,
calibrated timestamps and ray-tracing extensions are kept next to the
branch's presentation and feature enables.
- Command IR: Dispatch and Draw follow main's DebugMarker, ExecuteIndirect and
BuildAccelerationStructure in the variant.
- vulkan_backend.h: #1212's query_heap_type locked mutex_, which VulkanContext no longer has; query_pools_ is
guarded by resource_mutex_ (add/remove take it unique), so the lookup takes it shared. The runtime didn't build.
- test_salu64_bitwise_data (#1207): its wave64 store went through a V# with word3 = 0 (OOB_SELECT 0, stride 0),
out of range since #1104; it now uses the raw-buffer word3 the other semantic tests use.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Literal GFX10 samplers can encode bias from -32 to +31. A decoded +31 exceeded the Vulkan sampler limit on both tested devices at registration. Bound the native bias while retaining the original S# for shader lookup.
Conflicts in docs/d3d12_vulkan.md, runtime/CMakeLists.txt, check.py,
run_gpu_tests.py and test_shader_checks.py: main's versions with
vk_sampler_test, ps_ssharp and its checks added back (ps_ssharp is drawn
with vs_ids through DRAWN_WITH now).
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inject a failed submit to verify the speculative tracker is not committed. Exercise direct, compute and copy queue readbacks, verify their host barrier source stages, omit host barriers for batches without readback writes, and reject predicate capture on copy queues.
UINT/SINT image_load read the uint/sint storage arrays with OpImageRead, so
every typed load declared StorageImageReadWithoutFormat (missing on Intel
Xe-LP, #619), and read-only integer textures, which the runtime binds only in
the sampled arrays, read the fallback or past the 256-entry storage arrays.
They now fetch through uint/sint aliases of the dimension's sampled array;
a lookup miss takes the float path.
vk_store_test load fills the images before the dispatch, runs without
shaderStorageImageReadWithoutFormat and fails a module that declares it.
vk_image_fuzz no longer requires the without-format features, and binds
its UINT/SINT cases (#1087) as sampled images, as the runtime binds a
read-only texture, instead of storage-only images.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At the center of the test texture red and green have the same value. Exchanging the two packed halves passed that check on hardware while 3584 pixels contained the wrong colors.
A far-slot read alone cannot detect a stale descriptor after removal or a rewrite of the adjacent live view. Read the fallback, the replacement and its neighbour through the translated texture shader.
9,282 of the 26,503 shaders are mesh shaders, and a device without
VK_EXT_mesh_shader (NVIDIA Pascal, for one) can't run any of them. With
--mesh-compute each becomes a GLCompute module with the same workgroup size
and code; only the epilogue changes. After the same barrier, lane 0 writes
the vertex and primitive counts, lane i its vertex and its primitive, into
this workgroup's slot of an output buffer whose address is in push-constant
dwords 36-37 (152 bytes). The slot layout is mesh_compute_layout() and the
index records it as mesh_compute.
- tools/mesh_compute_vs.py: the vertex shader that draws the slots with a
non-indexed draw of groups * max_primitives * 3 vertices; unused and
culled primitives are clipped away, params keep their locations.
- vk_harness: VKH_MESH_COMPUTE (+ VKH_MESH_SLOT, VKH_MESH_PRIMS) dispatches
the module, adds a compute->vertex barrier and draws.
- run_gpu_tests.py / check.py: LEONIDA_MESH_COMPUTE=1 (check.mesh_env).
- tests/test_mesh_compute.py; docs/design.md row "Mesh shaders as compute",
docs/testing.md section.
GTX 1060 (Pascal) with LEONIDA_MESH_COMPUTE=1 LEONIDA_W64_EMULATE=1: all five
ms_* tests pass (SKIP before), zero validation messages. Mesh corpus: 9,282 of
9,282 translate and pass spirv-val with --mesh-compute --wave64-emulate, and
all 9,282 generated vertex shaders validate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSJXX67xeoorUsLJ2f9zms
Cube descriptors carry a minimum resource LOD but were excluded when building the sampled Vulkan view. Include them alongside array views so a point sample from a restricted cube cannot select an earlier mip.
#1155's comparison failed on an RTX 4060 Ti: NVIDIA's D3D12 driver returns, for 12 of 31 D24S8 / R24G8 rectangle
resolves, planes that match neither the clears nor WARP, while the layer matches both (WARP: 26 of 26). The layer
is already checked against the clears above, so such a case is now reported as a host quirk and counted, not failed;
a host that matches the clears still has to agree with the layer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 KiB alignment now counts the 4 KiB tiles covering the top mip of one
slice (at most 16; a volume's depth counts), instead of fitting the whole
image in 64 KiB. Multi-resource totals round up to the largest alignment,
saturate instead of wrapping, and an empty query is {0, 1}. Simultaneous
access with depth-stencil or MSAA, and a depth-stencil volume, are refused.
All measured against the host runtime on an RTX 5070 and WARP.