Commit Graph

5744 Commits

Author SHA1 Message Date
b464a2c529 FramePacer: at most latency frames in flight while armed (mailbox replace)
commit_present_token and note_untokened_present appended a slot for every
present, each one period after the last, so presents made with no
WaitFrameEventX between them grew the queue without limit and the next wait
blocked until the first of them was shown: at latency 2, 1000 blank presents
left 1000 frames in flight and the next wait passed 999 periods later.

A present into a full queue now replaces the newest queued frame and takes
its vblank, like a mailbox: the replaced frame is never shown (no display
statistic), the older frames keep their vblanks, and the queue never reaches
further than `latency` vblanks ahead, so the next wait passes when the oldest
frame is shown. A queue longer than a lowered latency is cut back the same
way at the next present. Presents before the event is armed stay unpaced
(old upstream PR 4419), and a frame behind a queued one still cannot be
shown at once.

frame_pacer_test: 1000 untokened presents after one wait at latency 1, 2
and 3, tokened presents beyond the latency (the older ones keep their
vblanks, the replaced one has no display statistic), the one-present-per-wait
cadence, and a lowered latency. xbox_present_test expected the blank present
after a frame at latency 1 to make 2 frames in flight; it is 1 now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:13:38 -05:00
48cb4bf039 docs/linux.md: add root-free micromamba setup section (DOC-LINUX-FEDORA-NOROOT) 2026-11-24 12:06:15 +01:00
0d666fcf4f pe_inspect: classify system DLLs on Linux through the Wine prefix, bundled names without case
On a host that isn't Windows, classify_dll marked the C runtime and every
system DLL `shim`: the bundled check was case-sensitive (an import of
MSVCP140.dll missed the package's msvcp140.dll), System32 doesn't exist and
the API-set query only works on Windows. The first look's to-do list was
wrong there.

- bundled: the game folder is listed once and compared lower-cased.
- elsewhere than Windows, `system` is checked in the Wine prefix's system32
  ($WINEPREFIX, else ~/.wine), without case, and API sets through the
  prefix's apisetschema.dll (version-6 schema; Wine installs no file for
  most of them).
- with no prefix, a DLL that is neither bundled nor owned by the runtime's
  shims (SHIM_TABLEs in runtime/shims, less owns_dll's host list) is
  "unverified", shown as `system (unverified)`; first_look.ps1 lists those
  after the to-do and warns.
- the report's new `system_dlls` field and the Markdown/stdout summary say
  where system DLLs were checked. Windows classification is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:00:38 -05:00
b8951357f1 pe_inspect: read the resource directory and the RT_VERSION block without its strings
Data directory 2 was never read, so the report said nothing about the version block, the one part of a PE that
names its build. The block's values are free UTF-16 text that can name the title, so the report holds no value:

- resources: the types present with entry and byte counts; named types are counted, not named.
- version: the fixed file info's numbers (file and product version, flags with their names, OS, type, subtype,
  date), the translations, and per string table each standard key with its value's length and SHA-256. A key
  outside the standard names is listed by its hash.
- problems: a resource tree or version block that is cut short, loops, points outside the file or has a bad
  signature is listed (offsets and counts only); the rest of the report is still written.

The Markdown report gets a Resources section and stdout one line per image with a version block. The tests build
a resource tree and a version block by hand, check that the made-up values reach no output, and cover a missing
directory, a cut file, malformed blocks and a loop in the tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 05:55:40 -05:00
82d6883bed pe_loader: trace delay imports bound to an unimplemented thunk; note delay-load and thread-attach order
Delay imports are bound eagerly (deliberate: --dry-run shows the whole import surface). A delay-loaded DLL or
function that nothing serves becomes an unimplemented thunk returning 0 at its first call, where Windows'
delay-load helper raises 0xC06D007E / 0xC06D007F, which a title can catch for a fallback. The binding is
unchanged; --trace now writes a delay_import_unimplemented event (module, import) for each such import at load,
so the first boot names them before any image code runs.

docs/runtime_imports.md gets two notes on where the loader differs from Windows: the eager delay binding above,
and that DLL_THREAD_ATTACH reaches TLS callbacks in TLS slot order, which puts the executable before the DLLs it
imports (Windows' order is undocumented). runtime/README.md lists the new trace event and now says the loader
applies DIR64 and HIGHLOW relocations and rejects HIGH, LOW and HIGHADJ (old upstream 761).

startup_trace_test gets a synthetic DLL with one ordinary and two delay imports (one missing, one bound to
kernel32): exactly one delay_import_unimplemented event, naming the missing delay import.

Findings by cynbun in the old upstream coordination issue (old upstream 7231).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 05:46:57 -05:00
a9bed902d2 rdna2spirv: VOP3 clamp of a NaN gives +0 (DX10_CLAMP)
Gen.clamp_mods applied the VOP3 clamp bit as a bare GLSL.std.450
FClamp, which is undefined for a NaN operand. The game's MODE has
DX10_CLAMP=1, under which the hardware turns a NaN result into +0
(measured on gfx1036: the v_rcp_iflag_f32 run and SHADER-186 for
v_fmac_f16 / v_fma_mix*). Select +0 for a NaN before FClamp, as the
div_fixup, cvt_pk_u8 and cvt_pknorm clamps already do. This covers
every f32/f16 op that applies clamp through clamp_mods/clamp_f16.

- tests/semantic/test_vop3_clamp_nan.py: NaN operands (quiet,
  negative, signalling) and invalid operations (inf-inf, -inf*0)
  under clamp give +0 for f32, f16 (low and high half), conversions,
  legacy and mix ops; controls without a NaN are unchanged. It fails
  33 subtests on the old translator.
- The two negative controls that expected the undefined FClamp
  (test_alu_f32_min_max, test_alu_min3_max3) now expect +0, and the
  f16 unary harness checks clamp of a NaN result instead of skipping.
- test_rcp_iflag_mods / test_f64_conversion match the new SPIR-V.
- docs/design.md and docs/shader_validation.md no longer list the
  f32/f16 clamp of a NaN as unmodelled. Still a bare FClamp: the f64
  clamp (open PR #475) and the packed v_pk_* clamp.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:10:13 +05:30
60fce7a747 startup_trace: LEONIDA_SKIP_INT3 works on title threads and with Wine's breakpoint address
Spacecer2 measured under Wine 11.22 (old upstream 7599) that LEONIDA_SKIP_INT3 never took
effect: the flag was a block-scope static first read on a title thread, whose
MSVC thread-safe-static guard passed with the object still zero, and the
handler's int3 set and the trace lock had the same shape.

- The flag is read by startup_trace::open(), on the thread that opens the trace,
  into a constant-initialized atomic.
- The trace lock is a constant-initialized SRW lock (no constructor, never
  destroyed), and the logged int3 sites are a constant-initialized table of
  atomics: the handler touches no block-scope static.
- The int3 is found from Rip (Windows) or Rip - 1 (Spacecer2's Wine run), and
  Rip always ends one byte past the 0xCC.
- skip_int3 returns false for a null EXCEPTION_POINTERS, record or context.
- LEONIDA_LOG_GAME_EVENTS and LEONIDA_HDR, read on title threads, are cached in
  namespace-scope atomics instead of block-scope statics.

int3_skip_test runs each case in a child process: real int3s, the Windows and
the Wine breakpoint forms, the null pointers, the flag read at open() and the
flag off. The wine, null and init cases fail on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 05:38:10 -05:00
80a12bfae4 gpu-test-results: RTX 5070 Ti (Blackwell, Windows 11, NVIDIA 617.42) on main 21625bca (GPU-RTX5070TI-WIN)
run_gpu_tests.py on a clean main build: 257/257 translated and valid;
197/248 passed, 49 skipped native, 229/248 passed, 17 skipped with
LEONIDA_W64_EMULATE=1; the two failures are the known tfe fixtures (#31).
Runtime CTest: 281 passed, 11 skipped, 1 disabled, 1 failed (the known
d3d12_execute_indirect_validation parity cases, #337 / #306).
ms_wave_info_s3 passes, so the original repository's issue 8369 no
longer reproduces on this GPU. The record is indexed in
docs/gpu_test_results.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:32:56 +05:00
62a95883b6 build: track native PSO catalog dependencies
Track the catalog writer and its local imports in the shader-stage fingerprint
and CMake fixture dependencies. Cover the same files in both Runtime event
filters, including the optional native scanner reached by the carver.
Check both import graphs and document the standalone catalog refresh for
existing translations.

On Windows x64, touching the writer rebuilt the three bindless fixtures once.
All three passed spirv-val and both Vulkan bindless tests passed on an RTX
5070 Ti with driver 617.42. The semantic suite ran 6,108 tests with no failed
files. The regenerated 25,321-row catalog matched the local reference byte
for byte.

AI-assisted: OpenAI Codex
2026-11-24 18:13:26 +08:00
8e63a1dd71 gpu-test-results: AMD Radeon RX 6900 XT (RDNA2, RADV Mesa 26.2.4) on main 21625bc (GPU-RX6900XT)
The first RDNA2 discrete desktop record in gpu-test-results/, and the first RDNA2 card
whose native subgroup is 64 wide: every wave64 fixture ran without
LEONIDA_W64_EMULATE=1, and setting it changed no result.

  build.py          280/280 translated, 280 pass spirv-val
                    wave64 VS/PS/GS on 32-wide subgroups: tier A: 11, tier B: 8, tier C: 13
  check.py          214 of 219 pass, 3 skipped, 2 failed
  run_gpu_tests.py  native                 230/248 passed, 16 skipped, 2 failed
                    LEONIDA_W64_EMULATE=1  230/248 passed, 16 skipped, 2 failed

Both failures are cs_imgload_tfe and cs_imgload_d16_tfe, "r32 sint (sint view): 64 bad,
texel(5,3) = 2071", in the native and emulated runs and in check.py alike. The fixture
expects 71 there (129 from the uint image plus -58 from the sint one) and seeds each of its
two fetch-status VGPRs with 1000, so 2071 - 71 = 2000 is exactly both seeds: the status
dwords are read and never written, while the uint view is exact in the same run. That is the
open SHADER-1266 / #31 question, where #98 was closed unmerged and a fixture-only correction
is pending. This record adds the RDNA2 words to it and claims no RDNA2-specific difference;
the counts match the Radeon 610M record (gfx1036, RADV) exactly.

The overlay layers that other hosts suppress are not installed here (MangoHud, vkBasalt,
gamescope WSI and Mesa device_select, which the loader does insert), so the RTSS/OBS switches
are no-ops; the native suite was rerun under VK_LOADER_LAYERS_DISABLE='~implicit~' as a
control and gave the same 230/248 with the same two failures.

Also adds the docs/gpu_test_results.md table row and section, and marks the stale "#98" note
in the Meteor Lake section as out of date.

Synthetic shaders from runtime/test/shaders only; no game files.

AI-assisted (Hermes Agent).
2026-11-24 17:10:33 +07:00
a60f66ee95 docs: d3d12_vulkan: how quad lists are drawn, indexed ones through the index expansion
The quad list entry of "Console rectangle and quad lists" described the fan per quad and
its two faults. It now describes both paths as one triangle-list draw, the compute pass
for indexed draws and where it runs, what it does with the base vertex, the strip-cut
values and indices past the view, what it needs, the measurement that replaced the fans,
and what is still not covered (ExecuteIndirect draws, which record no topology).

AI-assisted (Claude Code; Claude Opus 5.5 and Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-24 05:10:19 -05:00
6ce66cf219 d3d12: GPU test for indexed quad lists: both index sizes, a base vertex, flat inputs, overlapping instances (d3d12_quad_index)
d3d12_rect_list draws its quads without an index buffer, so it could not see what #207's
review measured on indexed ones. d3d12_quad_index_test draws six 64x64 frames through
DrawIndexedInstanced with IASetPrimitiveTopology(19) and compares every pixel bit for bit:

  0  non-indexed control
  1  16-bit indices, a quad whose corners all differ: the first vertex's colour everywhere
  2  32-bit indices from StartIndexLocation 3
  3  16-bit indices from StartIndexLocation 5 (an address of 2 modulo 4), BaseVertexLocation 3
  4  two quads and two instances whose quads overlap: the later instance on top
  5  a view that ends inside the second quad: its last two indices read 0

The index buffer is in a DEFAULT heap and filled by a copy in the first list, so only the
GPU can read it. Two translated fixtures, like vs_m15 and ps_m15: vs_quad_inst.asm reads
the instance id (v3) to move and recolour each later instance, ps_quad_flat.asm reads its
colour with v_interp_mov, which makes the input Flat.

RTX 4070 SUPER (621.24), Windows 11, LEONIDA_VK_VALIDATION=1:
  on the six commits of #207: frames 1, 2, 3 and 5 match in 0 of 4096 pixels (black and
  blue, the second and third vertex), frame 4 in 2048, frame 0 in 4096; exit 1
  with the expansion: 4096 of 4096 in all six, 0 validation errors

run_gpu_tests.py lists the two fixtures as run by this test, and docs/testing.md names the
test (and d3d12_rect_list) among those that need llvm-mc and the SPIR-V tools.

AI-assisted (Claude Code; Claude Opus 5.5 and Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-24 05:10:19 -05:00
abe64d495b d3d12: quad lists draw as triangle-list indices (0 1 2) (0 2 3) so flat inputs use the first quad vertex, and the PSO topology type is read as raw bits
Taken from the follow-up patch of @matheuskshn (930e78a2, tested by them on an RTX 4070 Ti: replay_quad_list_test fails the two non-indexed cases on a6b31d51 and passes with it). Re-run here: replay_quad_list_test and d3d12_rect_list_test exit 0 on the pod (Wine, RTX 4090).
2026-11-24 05:10:18 -05:00
0688b839ba d3d12: rectangle list stage emits (v1 v2 v4) (v1 v4 v3) with capability Geometry, log cut-off quads (review fixes) 2026-11-24 05:10:18 -05:00
21f07a063b d3d12: draw the console's rectangle lists (17, PSO type 19) and quad lists (19) as triangles
A rectangle list is three corners; the fourth is v2 + v3 - v1 for the position and every interpolant, after the vertex stage. A quad list is four vertices per quad. Vulkan has neither. A PSO with topology type 19 was refused (E_INVALIDARG) and the two list topologies drew as a plain triangle list.

Rectangle list: the PSO becomes a triangle-list pipeline with a generated geometry stage (src/rect_list_geometry.h), built from the vertex shader's own SPIR-V outputs, that emits the strip v1 v2 v3 v4. Quad list: one triangle fan per quad (0 1 2, 0 2 3), drawn with the index values 4q..4q+3 so the translated vertex id (VertexIndex - BaseVertex) is right; non-indexed draws read a shared 0, 1, 2, ... buffer reserved in the arena.

Facts from xvalkyrie (GPL-3.0, commit 53af7df77c10); no code copied.
2026-11-24 05:10:18 -05:00
9e77e974ee Merge remote-tracking branch 'upstream/main' into feat/native-graphics-shader-index 2026-11-24 18:06:59 +08:00
de286bf791 vk_subgroup_info: per_vertex_inputs needs VK_KHR_fragment_shader_barycentric listed
RADV (Mesa 26.2.6) sets fragmentShaderBarycentric on a gfx90c iGPU (Vega 8,
PCI 1002:15E7) that doesn't list VK_KHR_fragment_shader_barycentric, so
per_vertex_inputs read true there. run_gpu_tests.py then didn't turn on
--f16-interp-fallback and ps_interp_f16_high skipped; make_game.py reads the
same field and would keep PerVertexKHR inputs the device can't run.

The feature now counts only with its extension in the device's list. The
gfx90c/RADV measurement goes into docs/testing.md.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:02:30 +00:00
dfd62d7e26 docs: the recorded, never-called allocator callback of slot 9 has a row in the Xbox-only table
Asked for in review on #377.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
2026-11-24 03:52:41 -06:00
3ca10dfe1f docs: device slot 74's S_OK stand-in has a row in the Xbox-only table
Asked for in review on #377.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
2026-11-24 03:52:41 -06:00
9fd65a4ee5 docs/README: index dev-tools, cpu_features and directstorage (DOC-INDEX-MISSING-PAGES)
docs/README.md did not link three existing pages: dev-tools.md, cpu_features.md and directstorage.md. Add one row for each, in the table where its neighbours fit. Docs only; no game files.
2026-11-24 10:52:39 +01:00
49fd9a4275 d3d12_xs: slot 61 is CreateSamplerX only for the title's calls; a host caller gets PC CreateMetaCommand
The proxy also serves host callers: d3d12_vulkan_device_test drives the Vulkan device through it,
and its ID3D12Device5::CreateMetaCommand call (PC slot 61) landed in proxy_create_sampler_x
(found by nullmarsh on #7115: the test stopped at line 5763 instead of main's known line 6574).

Slot 61 now checks the caller's return address with a classifier the runtime installs
(set_console_caller, the name #7490 uses): D3D12XboxCreateDevice installs
rt::shims::mapped_image_base, so only a caller in an image the guest loader mapped gets
CreateSamplerX. Any other caller, and every caller when no classifier is installed, is forwarded
to the PC slot 61.

xs_proxy_mock_test checks all three cases: no classifier (PC slot 61), a guest caller (PC
CreateSampler with the same words; a null description skipped) and a host caller under an
installed classifier (PC slot 61). d3d12_vulkan_device_test again stops at line 6574, as on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 8f756ebe048af042638ce51a61490f35f4f44ee3)
(cherry picked from commit c915e1da45)
2026-11-24 03:52:20 -06:00
99ba1c085f d3d12_xs: Xbox device slot 61 is CreateSamplerX, routed to the PC CreateSampler
The retail title calls device slot 61 as CreateSamplerX(desc, dest handle), once
per sampler, after its descriptor heaps exist (stop 20 of the RT-5 boot
measurements in the coordination issue). The generic thunk forwarded it to the
PC slot 61, which is CreateMetaCommand, so the sampler was never written.

Slot 61 now has its own handler, like 62 and 67. It passes the description's
PC D3D12_SAMPLER_DESC prefix and the handle to the PC CreateSampler (slot 22).
That was enough to get the title past this call under Wine. Whatever follows
the prefix in the console description is not known and is not read. A null
description is skipped and logged once. A handle in the title's own heap range
is #7021's translation.

xs_proxy_mock_test: slot 61 reaches the mock's slot 22 with the same two words
and never its slot 61; a null description reaches nothing. With main's
d3d12_xs_device.cpp the new check fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit e22994464b)
2026-11-24 03:52:20 -06:00
c8247cdfa3 d3d12_xs: a console indirect argument of type 105 is created as DISPATCH (slot 41)
The retail title creates five one-argument command signatures with no root
signature at startup (device slot 41, CreateCommandSignature at its PC
position). One has the console argument type 105 and a 12-byte stride, next
to a DISPATCH and a DISPATCH_MESH of 12 bytes. The PC layer refuses the
unknown type, which is stop 19 of the RT-5 boot measurements.

Read statically from the title's call sites (shapes only): the two
ExecuteIndirect sites of that signature pass MaxCommandCount 1 and an offset
into the same argument buffer as the DISPATCH sites. Right before, they set
the same compute state as the DISPATCH path (pipeline, compute root signature,
tables, constants, SRV and UAV); they record on a second command list of the
title's context. So the argument is taken as a D3D12_DISPATCH_ARGUMENTS.

Slot 41 now has its own handler. A description that holds type 105 is copied
with that type replaced by DISPATCH (logged once). Any other description is
forwarded as the same pointer. What the console does differently for type 105
is left open in docs/d3d12_vulkan.md (section 4.9).

xs_proxy_mock_test: a two-argument description (a root constant, then type
105) reaches the PC slot 41 as a copy with DISPATCH, the same stride, count,
root signature, IID and output, and the caller's description is untouched; a
PC description is passed through unchanged. With main's d3d12_xs_device.cpp
the new check fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 4c04c0f4e3)
2026-11-24 03:52:20 -06:00
0ce4c5da8c cf_gpu_run: run the FUZZ-8 control-flow programs on a Vulkan GPU
tools/cf_diff.py checks the generated control-flow programs against two
CPU models only (cf_ref and the SPIR-V wave interpreter), so nothing
showed what a driver does with the translated control flow: how it
reconverges after a divergent if/else, a per-lane loop with a break mask
or a saveexec idiom.

tools/cf_gpu_run.py takes the same programs, turns each into a one-wave
compute program that stores v8..v11 of every lane, runs it through
vk_fuzz_run (translator + vk_compute_test) and compares every lane with
cf_ref, in wave32 and in wave64 (LEONIDA_W64_EMULATE=1 on a 32-wide GPU).
Before a campaign it runs a control, a reference with a flipped branch
that must differ from the GPU's result, and does not start if that fails.
A skipped program is counted with its reason and is never a pass. Exit
status: 0 no mismatch, 1 mismatch (minimised in summary.json), 2 nothing
ran, 3 control failed.

vk_fuzz_run.run_programs gets encoded=True for complete listings that
already carry `; encoding:` byte counts, so they skip llvm-mc. A program
the translator does not translate now reports the translator's last
error line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 10:51:36 +01:00
24914e7298 d3d12: preserve PC descriptor validation in slot 25
(cherry picked from commit b4d1ba1794)
2026-11-24 03:48:25 -06:00
e090be908d d3d12_xs: committed resources lease their size through the title's XMem hooks (RT-5 stop 17)
On the console a committed resource's memory is allocated with XMemAlloc, so it goes
through the title's __XMemAllocationHooks__. The retail title budgets its first
full-screen render targets with a per-thread hook that bump-allocates out of a range it
reserved and asserts that less than 2 MiB is left; PC resources never allocated through
the hooks, so the assert always fired. Slots 76 and 127 now allocate the slot-25 size of
each resource through the hooks, held by the resource with SetPrivateDataInterface and
freed when it is destroyed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ae322dafc5)

Adapted to main by Mumogg: the lease size is the later form of this series (d61755d4d, a render target's console
tile size, else the PC size), since console_render_target_extra is gone after 359390833.
2026-11-24 03:47:22 -06:00
8eaccded7f d3d12_xs: console render target sizes follow each resource's alignment, slot 56 offsets, full mip chains, rounded-up mip extents, B5G5R5A1, saturating sums
(cherry picked from commit 359390833f)
2026-11-24 03:47:22 -06:00
6b75cbafbc d3d12_xs: device slot 25 gives the PC device clean resource descriptions (RT-5 stop 16)
The title's descriptions carry the Xbox layout word and flag bits above the PC ones. Slot 25 now passes a copy with PC flags and a PC layout; the title's array is not written. Depends on #7078.

(cherry picked from commit c7ca0f2d1c)
2026-11-24 03:47:22 -06:00
f59167ef9c d3d12_xs: device slot 25 pads a render target to whole console tiles (RT-5 stop 17)
The retail title asserts when its first full-screen render targets leave more than 2 MiB of a fixed budget unused (docs/retail_boot_chain.md, #6982). The PC size is about width x height x element bytes; the console takes whole RDNA2 SW_64KB tiles. Slot 25 adds the difference per render target description and never lowers a size. Depends on #6973.

(cherry picked from commit 8897855399)
2026-11-24 03:47:22 -06:00
ce98fbefee fix: rdna2spirv decodes scalar, image and buffer tuples that run into vcc from the blob when llvm-mc rejects them
llvm-mc skips the first word of s_buffer_load_dwordx8 into s[100:107], an image resource in s[100:107] or a buffer resource in s[104:107] and leaves the second word as junk, so translate() refused those shaders (reachable instruction with normalized encoding) or translated them without the load. restore_vcc_tuples reads the uncovered words of the code range with rdna2_decode and keeps only instructions whose operands hold a VCCTuple list, the form the translator already takes. Other undecodable words are unchanged.
2026-11-24 09:33:38 +00:00
73d2d4cd6c Merge pull request #552 from GeorgiyDemo/gpu-m5pro
Why merged: adds an Apple M5 Pro / MoltenVK 1.4.2 GPU record and its row in docs/gpu_test_results.md, matching the existing rows.
Why it's good: synthetic fixtures only, no game data; clean on main 7430f59; consistency 565/0 before and after.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 04:26:10 -05:00
0f8ab027a5 Merge pull request #550 from Stephan2620/docs/cs-dpp-ops-moltenvk-row-continued
Why merged: docs/testing.md's MoltenVK 1.4.2 cs_dpp_ops row now points at the translator fix main already carries (SHADER-529, 4d65bae6b).
Why it's good: one row; docs tests still pass (design_rows 5, image_fuzz 63, valu_fuzz 80); clean on main 7430f59; consistency 565/0.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 04:25:55 -05:00
1ea2ffbcad rdna2spirv: s_bitreplicate_b64_b32 into VCC, s_flbit_i32_b64 of a lane mask
- s_bitreplicate_b64_b32 with a VCC destination: lane L gets S0 bit L // 2,
  stored as mov64 stores a mask into VCC (EXEC already took this path).
- s_flbit_i32_b64 of a lane mask reads the wave's whole mask (wave_mask), as
  s_ff1_i32_b64 does; s_flbit_i32_i64 of a mask stays Unsupported.

Both occur in pipeline-library compute programs that the retail boot creates.
Tests: tests/semantic/test_lane_mask_bitreplicate_flbit.py runs both on every
lane of a wave64 (run_workgroup); docs/design.md contract rows updated.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 03:25:31 -06:00
49d904fef6 tests: GPU readback for dynamic 64-bit vector shifts (GPU-VALU64-SHIFTS)
Exercise boundary counts and overlapping destination registers with runtime inputs.
AI-assisted with Codex.
2026-11-24 10:15:23 +01:00
4b9a89124a fspx_unpack: code_range takes the 24-byte prologue of some pipeline-library programs
50 of the 2,684 library programs in shaders.rpf (1.0.2.1) start with two VOP3
opcode-0x180 words (words 0 and 3) instead of three, and their code starts at
word 6. code_range only knew the 36-byte form, so it disassembled them from
word 0 and they never decoded: 1 of the 50 translated. With the 24-byte form
all 50 disassemble with 0 invalid words and 49 translate and pass spirv-val.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 03:08:08 -06:00
fed2fd6d05 Merge pull request #450 from EdenBendheim/ubiq/boot-trace-xmem-physical-pages
Why merged: the boot trace now lists XMem physical page requests, with sanitized input.
Why it's good: security-reviewed; on main 1c93c86: boot_trace tests 33 -> 37 (5 of the new tests fail without the fix); repo-consistency set 563/563, 0 failures.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 03:52:12 -05:00
cb36902743 Merge pull request #437 from bobcatchris/exe-sha-preflight
Why merged: adds a read-only, standard-library-only check that a contributor's executable matches the recorded size and SHA-256 (no hashes of the game embedded; nothing downloaded).
Why it's good: security-reviewed; tested on Windows 11 + RTX 4070 SUPER on main 1c93c86: clean merge, exe_sha tests 9 -> 20 passed; the repo-consistency set stays 563/563 with 0 failures.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 03:51:57 -05:00
10b0052e57 cs_div_fmas_f64_rt: the run-time-operand twin, and name the measured GPUs
Review of #8750: the fused half of the claim had no fixture. The new
cs_div_fmas_f64_rt reads the same a and c from s4..s7 (VKC_SGPRS), so the
driver cannot fold the Fma; it is fused under the default GLSL Fma on the
RTX 4090 here. design.md now names the measured GPUs: the all-constant
Fma is split on the RTX 4090, RTX 3070 and Quadro RTX 4000 (Turing,
Linux) and fused on an RTX 5060 Laptop (Blackwell).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:41:59 +03:00
ce75f144c7 docs/design.md, rdna2spirv: NVIDIA splits a binary64 Fma only when it folds an all-constant one
Correcting #6635's wording. On an RTX 4090 (621.24) the split 0 of the
fma(a, a, c) probe comes from the driver folding an all-constant GLSL Fma
while compiling the pipeline: cs_div_fmas_f64's operands are literals.
The same values read at run time from user SGPRs (VKC_SGPRS) give the
fused 2^-60, as #4536 saw on an RTX 4070. --fma khr is still what makes
both single-rounded. Wording only in design.md's floating-point row,
cs_div_fmas_f64.asm's header, Gen.emit_fma64's docstring, the runner's
split note and test_fma_khr_f64's docstring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:41:59 +03:00
fbc9aaf70f gpu-test-results: Apple M4 (MoltenVK 1.4.2, macOS 27.3) on main 1c93c86 (GPU-M4) 2026-11-24 09:18:53 +01:00
0a81e16316 docs: clarify the pipeline library host comparison 2026-11-24 13:12:14 +05:00
9cc72fde64 docs: fix GPU result submission instructions 2026-11-24 09:48:15 +02:00
0d27fdcf9a GPU fixture cs_imgstore_cube: image_store on dim:SQ_RSRC_IMG_CUBE (GPU-CUBE-STORE)
The "Typed image stores" contract row said a cube storage image was
CPU-checked only (test_image_cube_store_glc.py) and that no GPU fixture
covered it. This adds one:

- runtime/test/shaders/cs_imgstore_cube.asm: rgba8 unorm, r32 uint and
  r32 sint T#s (word3 TYPE = SQ_RSRC_IMG_CUBE); 64 threads store to every
  texel of all six faces, with per-face values so a wrong layer shows.
- vk_store_test "cube": three cube-compatible 8x8 six-layer images bound
  as six-layer 2D-array storage views at bindings 11/12/13, as the
  runtime binds a cube UAV; checks every texel of every layer.
- run_gpu_tests.py and check.py run it; test_shader_checks.py counts it.
- docs/design.md: the row names the fixture and the GPUs it passes on.
  Builds on #44, which rewrote that row.

Passes on an RTX 4070 Ti (NVIDIA 620.70.06) and a Radeon 610M (gfx1036,
RADV Mesa 26.2.6), native and LEONIDA_W64_EMULATE=1. The same fixture
with the face held at 0 fails on both (320/384/384 bad texels).

AI-assisted. No game files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 01:47:49 -06:00
cf3951e754 docs/design.md: name the GPU fixtures of six atomics rows (DOC-GPU-VERIFIED-ATOMICS)
Six contract rows ended with "Not GPU-verified" although fixtures on main
already run them through scripts/run_gpu_tests.py and check.py:
cs_lds_atomics_ext, cs_lds_xchg64_ext, cs_global_mem_ext, cs_w32_fcmpswap
and cs_w32_new_ops. Each row now names its fixture, the forms and cases it
compares, the GPUs it passed on (Radeon 610M, RADV Mesa 26.2.6; RTX 4070 Ti,
620.70.06), and what stays unchecked.

Rows: 8/16-bit global stores and d16 loads, ds_cmpst_f32 / fcmpswap,
ds_mskor, ds_{inc,dec,rsub}_u32 / ds_{min,max}_f32, ds_wrxchg2_rtn_b32,
ds_and/or/xor_b64. Row 279 also gets back the opening ** of its
"Hardware-measured natively on gfx1100" note.

Left out: Global atomics (32-bit) and buffer_atomic_{and,or,xor,swap}_x2,
which open pull requests #191 and #174 rewrite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 01:47:48 -06:00
367d91ef23 GPU fixture cs_imgatomic_ext: image_atomic_{swap,inc,dec,fmin,fmax,fcmpswap} (GPU-IMG-ATOMIC-EXT)
The row for the six remaining 32-bit MIMG image atomics was CPU-checked
only (tests/semantic/test_image_atomics_32.py) and said "Not GPU-verified
on RDNA2". This adds the GPU fixture, judged through vk_store_test's
"words" mode and check.py's STORE_WORDS like cs_imgatomic/cs_imgatomic3d:

- all six ops on the 2D r32 uint image (binding 4) and the volume
  (binding 7); inc/dec on both sides of their wrap and with a D that is
  negative as a signed number; fmin/fmax with a NaN data register;
  fcmpswap equal, unequal, +0 against -0 and NaN; glc and non-glc
- inc/dec/fmin/fmax from all 64 threads on one texel, which runs the
  translator's CAS loops under contention
- inactive lanes held on a trap texel that must keep its fill

The cases leave out what the ISA and SPIR-V leave open: NaN or denormal
texels for fmin/fmax/fcmpswap and +0 against -0 for fmin/fmax.

Exact on a Radeon 610M (gfx1036, RDNA2, RADV Mesa 26.2.6) and an RTX
4070 Ti (NVIDIA 620.70.06), native and LEONIDA_W64_EMULATE=1. Five
planted translator faults (signed inc/dec compare, fmin/fmax exchanged,
fcmpswap without the +0/-0 rule, no inactive-lane guard, no glc return
from swap) each fail it on both. docs/design.md records the GPU check.

AI-assisted. No game files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 01:47:48 -06:00
7fb8d37289 gpu-test-results: Apple M5 Pro (MoltenVK 1.4.2, macOS 26.7.3) at d42773d07 (GPU-M5PRO) 2026-11-24 10:42:14 +03:00
51639a60f2 Merge pull request #440 from oddmaniv/docs/gameinput-host-diagnostics
Why merged: an 8-line docs note telling native GameInput host failures apart, worded cautiously.
Why it's good: no game data; docs tests and check_no_game_data pass on main d42773d plus this PR.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 02:40:41 -05:00
a2e85b6e8d Merge pull request #436 from luckyteagirl/codex/doc-index-gpu-results
Why merged: a one-line docs index link to the GPU test results page.
Why it's good: the link target exists; docs tests (links, encoding, tables, i18n) and check_no_game_data pass on main d42773d plus this PR.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 02:40:26 -05:00
57ae634cdb docs/testing.md: the cs_dpp_ops MoltenVK 1.4.2 row is fixed in the translator (SHADER-529)
The Known problems row still sent Mac users to MoltenVK main or KosmicKrisp.
Since #3227 the DPP lowering stores its ballot and shuffle to variables of
their own, and the MSL MoltenVK 1.4.2 generates from current main runs both
as statements in every lane. The row now says so, and that a pass on a Mac
does not prove it: an Apple M5 Pro gives the right words with 1.4.2 even
when the ballot sits on the right of &&.
2026-11-24 08:32:34 +01:00
14513af943 tests: separate pipeline library blob validation from host parity (TEST-PIPELINE-LIBRARY-OWN-FORMAT) 2026-11-24 12:04:30 +05:00