Review on #1756 (Vonsek):
- The trace is opened before the loader reads the image, so `wb` could
truncate an input named by mistake (the image itself). open() now
uses "x" mode and fails with EEXIST on an existing path; gta6rt says
so and exits with 2.
- OutputDebugStringA text is in the ANSI code page. It is converted
to UTF-8 before quoting, so a byte such as 0xE9 no longer breaks the
JSON lines. Host module names now come from GetModuleFileNameW,
converted to UTF-8, for the same reason.
startup_trace_test: an existing file is refused with EEXIST and its
bytes survive, the trace stays off; an ANSI debug string with 0xE9
appears as its UTF-8 form and the whole file is valid UTF-8.
- vk_pipeline_check.cpp: #1826's --isolate-batch parsed with the val() helper #1735 replaced, so the checker
didn't build; it now uses number() like the other options.
- check_vk_pipeline_cli.cmake (#1735) matched "malformed JSON"; #1847's index parser names the file and position
("index.json: expected '{' at byte 0"), which the check now matches.
- test_tbuffer_store: BUF_FMT_8_UINT stopped being an unsupported example once #1871 added the 8/16-bit UINT/SINT
formats; it uses BUF_FMT_8_USCALED.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A container the translator left out (for example a module over SPIR-V's id bound, like the #881 pair in a work
folder translated before dcd8ecf) has no index entry under its name, so the lookup has nothing to find. The test
reported it as `not found under its <stage> stage`, the same line as a real lookup miss, so an older work folder
looked like a shader_library regression.
The test now reads index.json's entry names (with the same "string stage and fssm_sha256" rule ShaderLibrary::load
counts) and checks a container that isn't found: with no entry named after it (the stem or a `~N` duplicate) it is
reported as `NOT TRANSLATED (no index entry)` and counted in its own field of the summary, with a hint to rerun the
shaders stage; with an entry it stays a lookup failure. The exit code is unchanged: either makes the test fail.
shader_library.h is not touched.
Tested on Windows 11 Pro 25H2, MSVC 14.51 + Ninja, RTX 5070 Ti / 621.24, with my own 1.0.2.1 copy's work folder
(translated at 43d0015):
- the real corpus: `26503 containers, 26501 index entries, 26501 reached; 195 containers with more than one
program; 2 not translated; 0 failures` (before: `2 failures`, as `not found under its cs stage`). The two are
the #881 pair.
- controls on a scratch folder of copied containers: one under another shader's indexed name is still
`FAIL not found under its cs stage`; one under a name with no entry is `NOT TRANSLATED`; the normal one resolves.
- without LEONIDA_SHADERS it still skips (exit 77); shader_library passes. No game data in the repository.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both ran their LDS ops in all 32 lanes on one address before cutting EXEC
to lane 0, the race #1850 found for ds_xor_b64: lane 0's ds_cmpst_rtn_b32
old value (cs_w32_misc_ext) and ds_wrxchg2_rtn_b32 old word
(cs_w32_new_ops) are only the expected ones when lane 0 goes first. They
passed on every GPU so far, but the order is not guaranteed. v_cmpx now
comes before the LDS block; the expected words are unchanged. The CPU
fixtures can't see it (each invocation has its own LDS in
spirv_mini_interp), so each fixture test now checks the source order.
Writes one JSON object per line, flushed per event: module maps, TLS
callbacks, DllMain results, the first call of each unimplemented import
with its caller as module+RVA, OutputDebugString text, exceptions with
module+RVA and a short unwind, and the exit code. A vectored handler
records and returns EXCEPTION_CONTINUE_SEARCH, so behaviour is unchanged.
Off by default.
startup_trace_test builds a synthetic DLL image (no game data) and
checks each event kind.
Differential error and argument validation cases that do not alter device
residency, touch the sharing subsystem, or fault on the PC runtime are now
executed in-process directly against the backend's devices. Cases modifying
residency (1, 2, 26..29), creating shared handles (30, 31), or faulting under
SEH on the host runtime (17..20, 25) remain isolated in child processes.
LEONIDA_QUEUE_PROXY_ISOLATE_ALL=1 is supported as an override to force all
cases into child processes.
Tested on Windows 11 with MSVC 19.51, NVIDIA GeForce RTX 3060 (WARP + hardware
+ Vulkan backends): execution time drops significantly with zero leaks and 3
backends passing cleanly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under Wine's macOS driver the test failed at its last step, the GDI read of the screen: GetPixel on the screen DC
returns CLR_INVALID there for every pixel, even one GDI painted itself (BitBlt from the screen DC fails too), and
the window's own DC holds Wine's GDI surface (white), not the image presented through the Metal layer. The
presenter itself was fine: all the injected-failure checks passed, MoltenVK made 320x240 and 400x300 swapchains
at contents scale 1.0, and the driver reported no out-of-date presents. The "present failed" lines in that log
(VkResult -1000001004 twice, then -1 = VK_ERROR_OUT_OF_HOST_MEMORY) are the test's own injections; markers around
them showed each line inside its injection.
The test now enables the presenter's capture and checks the whole presented image for the clear colour at the
swapchain's size after the first 60 frames, after the resize and at the end, on every platform. The screen check
stays where GDI can read the screen; a CLR_INVALID there is reported and skipped instead of failing. The test also
says on stderr that the next three "present failed" lines are expected, since they were read as faults twice.
Checked under CrossOver's Wine 11 with MoltenVK 1.4.3 on an Apple M3 Max: the test passes, and with the clear
colour changed the capture check fails at the first 60 frames.
Other Xbox Series compatibility-layer efforts have run the same package's
console DLLs, shader pack and retail titles. This folds their published
measurements into docs/d3d12_vulkan.md §7 — the CS root-argument packing, the
inline record opcodes, the mesh inputs, the OpenExistingHeapFromAddress UMA
recipe, 64 KiB physical pages, more command-list slot numbers and the console
export surface — each row paraphrased with its measurement basis noted.
The unimplemented-import classifier learns the console DLL names from that
surface (d3d12_xs!D3D12XboxCreateSyntheticDevice, xaudio2_9!XAudio2Create,
gameinput!GameInputCreate, dstorage_xs!DStorageGetFactory) so fail/stop
policies report E_NOTIMPL honestly instead of faking success; functions with
no measured return (xg_xs, AcpHal, D3D12XboxSetProcessDebugFlags) stay `other`.
Classification checks added to unimplemented_policy_test.
AI-assisted. Tested: test_i18n_index, test_docs_links, compileall. The
registry/test change is Windows-only C++ and was not compiled here.
heap_desc_refusal now also refuses D3D12_HEAP_FLAG_ALLOW_DISPLAY and
HARDWARE_PROTECTED, which the D3D12_HEAP_FLAGS documentation says
CreateHeap does not support (review on #1820). Both are host-comparison
cases in compare_invalid_arguments, awaiting a host run, and direct
refusal checks on the standalone device.
CreateHeap1, its heap1 test cases and the heap_create1 helper are
removed: #1846 implements CreateHeap1 over CreateHeap and inherits these
checks. The docs keep #1846's CreateHeap1 line untouched and describe
the CreateHeap checks under the heap bullet instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CreateGraphicsPipelineState refused every SampleDesc.Quality but 0. Native
D3D12 (RX 7800 XT, a Radeon iGPU and WARP) accepts 0,
D3D12_STANDARD_MULTISAMPLE_PATTERN and D3D12_CENTER_MULTISAMPLE_PATTERN and
refuses 1 (past NumQualityLevels). The standard pattern is Vulkan's standard
positions, so it is accepted; the centre pattern needs custom sample
locations and is refused with a log until those exist.
At replay every bound render target and depth target must have the PSO's
sample count (D3D12 leaves a mismatch undefined, Vulkan's dynamic rendering
forbids it), so a mismatched draw fails the list with invalid_subresource
instead of reaching the driver.
d3d12_msaa_draw_test (in ctest): 4x draws with a depth target, SampleMask 0x1
and ResolveSubresource; the quality rules; a 4x PSO into a 1x target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replay refused SetPredication, predicated buffer copies and D24/RGB96 footprint conversions while a
pipeline-statistics query was active (#1624 added the last), because their compute dispatches would count in the
application's CSInvocations. They now get the segment split #1519 gave resolves: the statistics query ends its
current physical segment right before the helper dispatch and begins the next right after it, and its result is
the per-counter sum of the segments. Query resolves and these helpers share one segment numbering. The markers for
non-query commands live on detail::Prepared, and emit() places them around capture_predicate,
emit_predicated_copy and the depth24 conversion parts, outside any rendering scope.
Without a statistics segment pool (the single-list replay(), or a queue without the summation helper), the three
commands are still refused while statistics are active, before any helper scratch is allocated (prepare() takes
statistics_helpers, false by default) and again in QueryReplay::plan.
Tests (Khronos validation on): vk_predicated_copy and depth24_convert run their helpers inside an otherwise empty
statistics query. Their results stay byte-exact and all 11 counters are 0. d3d12_predicated_copy compares with
WARP the same way. replay_query_predication checks the emitted order for a capture, a predicated copy, a footprint
copy and a resolve in one query, and the refusal without a pool. predicated_copy and typeless_rtv check both
preparation modes.
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--wave64-emulate adds %x_buf (2L + 6W + 7 dwords) on top of the LDS
array, so a 64 KiB LDS made modules over maxComputeSharedMemorySize,
which spirv-val accepts and RADV dies on (#1721).
Translator: a 64 KiB hard cap (MAX_SHARED_BYTES, --max-shared-memory).
Over it, the pow2-rounded LDS array shrinks to the room left when the
program's need fits (indices wrap with OpUMod); otherwise the shader is
refused (Unsupported, with the byte counts). lds_bytes in index.json is
now the whole Workgroup total.
Runtime: the D3D12 shim's create_compute compares lds_bytes with the
device's maxComputeSharedMemorySize (32768 on AMD Windows and Intel)
and refuses the pipeline with a log line instead of creating it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured natively on an RDNA2 iGPU (gfx1036): v_cvt_pk_u8_f32 rounds to
nearest even, clamps to [0, 255] and gives 0 for NaN. The RoundEven rule
was right; NaN reached FClamp, which is undefined for a NaN operand, so it
is now replaced by +0 first.
cs_cvt_pk_u8.asm holds eight hardware words (four byte selects), checked
by check.py and run_gpu_tests.py, and bit-for-bit on the CPU by
tests/semantic/test_cvt_pk_u8.py. Contract-table row added.
Fixes#358