Commit Graph

5744 Commits

Author SHA1 Message Date
9dfd8c13ee fix(shader): end the geometry strip after a combined emit and cut
GS_OP_EMIT_CUT closes the strip after adding its last vertex. Treating it as a plain emit connects disjoint strips and rasterizes triangles across the gap.
2026-11-22 19:59:51 +01:00
99342e6300 docs: correct SHADER-181 pair classes after packed-mask census
AI-assisted. Depends on: #2735.
2026-11-22 19:59:18 +01:00
9359bfcb3b docs/design.md: SHADER-10 census re-run on current main; the 195 corpus GS are tier A with the GS ring rule
The census in the row predated the GS ring rule (TEST-251) and #1982; re-run over the same 1.0.2.1 corpus:
tier A 2,117 (was 1,919), GS 195/0/0 (was 0/0/195). The row's open question (whether the corpus GS were a false
tier C) is answered by it.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:59:11 -05:00
093b6c622a TEST-433: skip the tier A/B pixel fixtures where the fragment subgroup is narrower than 32 and cannot be required
Intel UHD 770 reports fragment subgroup 8..32 but runs pixel shaders 16 wide and cannot be held to 32, so reads
across 16 lanes (permlane, swizzle, bpermute) fail there. Tiers A and B mean exact on 32- or 64-lane subgroups.

The SHADER-10 row also loses the stale text the merge of #2260 left in it: the pre-TEST-319 A list (bpermute and
permlane "not GPU-tested here"), "Corpus coverage is not measured here", "the corpus ones are wave32", "geometry
shaders are not tested" and a repeated sentence, which the census and the GS fixtures (TEST-251) now contradict.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:59:11 -05:00
9bebfb1070 Merge remote-tracking branch 'origin/main' into queue-wait-before-signal 2026-11-22 19:58:49 +01:00
efcd434cfc boot: keep the first D3D12 call from a PowerShell 5.1 log
PowerShell 5.1 wraps the first stderr line of a native program in an error
record: `d3d12_test.exe : [d3d12-trace] #1 ...`. The anchored tag match
counted that line as noise, so the summary lost call #1 and still exited 0.
The tag may now follow a `<name> : ` prefix; a fixture and a dedicated test
keep it.

docs/boot.md says the prefix is accepted and that the BOM from
Out-File -Encoding utf8 is stripped.
2026-11-22 15:58:29 -03:00
5497864ff4 D3D-345: Document the T# image-key address range
Updated image key alignment and allocation details in Vulkan documentation.
2026-11-22 22:27:31 +03:30
b270140c6d Merge pull request #2398 from Kam471
# Conflicts:
#	docs/README.md
#	docs/design.md
2026-11-22 13:57:31 -05:00
c2d42e9d9c docs/i18n/it: one sync line and one index row after merging #2213's update
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:57:29 -05:00
9f6d4c683d Merge upstream/main 2026-11-22 19:57:28 +01:00
23b458b5f8 rdna2spirv: image_sample_c and image_sample_c_b, depth compares with implicit LOD (EGEN-MIMG-SAMPLE-C)
image_sample_c / image_sample_c_b (and their _o forms) were Unsupported. In a
pixel shader they are OpImageSampleDrefImplicitLod (Bias for _c_b); LOD 0 for
_c elsewhere. The _c_b address order is bias then z-compare (the parser read
the compare first). vk_texture_test now honours LEONIDA_VK_DEVICE. GPU tests
ps_sample_c and ps_sample_c_b, semantic tests, design.md row.

AI-assisted.
2026-11-22 19:57:23 +01:00
d586d05310 rdna2spirv: v_fmamk_f16 and v_fmaak_f16
Both were rejected while the f32 forms are translated. In print order
both are a[1] * a[2] + a[3] (fmamk S0 * K + S1, fmaak S0 * S1 + K), with
K the literal's low 16 bits (a float literal converted to f16), one
rounding to f16 as v_fmac_f16, and the high half kept (GFX10 f16 VOP2).

tests/semantic/test_valu_fmamk_fmaak_f16.py compares both with v_fma_f16
with K in a VGPR. docs/design.md row added.
2026-11-22 15:57:04 -03:00
38f893325a meshlet_page: 42 40 slots 11 and 18 are tangents (10:10:10, sign in bits 30-31)
Unit vectors perpendicular to the stored normal: 98.9% of 7,520,441 minigame
tangent words within |dot| < 0.05; bits 30-31 are 3 or 0 in every one
(+1 / -1). tangents_4240, tangent_agreement under --normals, a test, and
docs/story.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:55:13 +01:00
22ed0b5179 Runtime: support short typed buffer UAV clears 2026-11-22 14:55:06 -04:00
a14ddbc63c gta6rt: GAME: and the overlay are absolute, so a bare image name has a game folder
`gta6rt --run game.exe`, started from the game folder, set the game folder to the image's parent path, which is
empty for a bare name: the run printed `console paths: GAME: -> , writes -> overlay` and every GAME: open failed
with ERROR_PATH_NOT_FOUND. A relative --game-dir or --overlay worked only until the title changed its current
directory. main.cpp now makes both absolute at startup (keeping the path as given if absolute() fails).

New CTest run_tiny_game_dir: tiny_game's opt-in `game-file` check moves its current directory, then reads
GAME:\tiny_game_probe.txt; check_game_dir.cmake runs it by bare name and with `--game-dir .`. Without the fix both
fail (open errors 3 and 2); with it both pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:24:49 +05:30
49cad88120 docs/models.md: effect-record ordinals count within one of shaders.rpf's two SGD5 databases
The group walk (@jeremygold02) reproduced on the same archive: 11,018 /
10,944 / 195 / 0 / 0 / 2,647 programs and 910 effects in the first
database, 500 / 1,157 / 0 / 0 / 0 / 42 and 22 in the second, adding up to
the whole carve. Group 2 is the GS. His census of both databases' effect
tables is reported as his.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:54:40 -03:00
4896856544 tests: d3d12_descriptor accepts a floored fractional image-view minimum LOD, which Vulkan permits 2026-11-22 13:51:04 -05:00
673d3d16c0 Merge pull request #2377 from Kam471/docs/sixstars-verified-format-facts
docs: record the 6stars format facts that reproduce
2026-11-22 12:50:28 -06:00
4875b49fba docs/design.md: one no-op SOPP/SMEM row, one output-modifiers-hardware row; multiply-add row keeps its GPU-checked verdict 2026-11-22 19:50:15 +01:00
7fc999eead design.md: the game's float VALU modifier forms measured on RDNA2; test with the measured words
572 distinct forms with clamp/omod/op_sel/neg (1,270,932 instructions in the
26,503 listings), 542 swept natively on gfx1036 through tools/hw_oracle in
the game's MODE, 64,802 cases: 51,761 give the translator's word; the rest
are differences already on record (NaN payload, f32 denormals SHADER-377,
omod -0 -> +0 #1281, rcp/log/sin ulps, FClamp of NaN #2437). The test
replays 1,616 words and fails without clamp (326) or omod (237).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:49:24 +01:00
f12da53a58 D3D-329: measure where the descriptor-heap base reaches a heap-indexing shader
tools/heap_index_census.py follows every descriptor-width scalar load back to
the SGPRs it starts from (entry SGPR, constant, loaded pointer) per stage and
SFI0 heap-indexing class, and prints counts only. Over the 1.0.2.1 corpus,
99.86% of 770,412 descriptor loads start from an entry SGPR used as a 32-bit
pointer, none from a loaded pointer; heap-indexing shaders add a base read
with a run-time offset, and the stride is compiled into the offsets.

docs/d3d12_vulkan.md records the result in section 3.4 and the direct heap
indexing bullet: user data for compute (COMPUTE_PGM_RSRC2 USER_SGPR), below
s32 for the graphics stages whose user count is not measured yet.

tests/test_heap_index_census.py covers it on hand-written listings and
containers (no game files).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:49:11 +01:00
4e710cf7eb fix(shader): read incoming VGPRs for preserving SDWA writes
A byte or word insert consumes the old destination when its other bits are preserved. Discovering that input lets a fragment retain the untouched bits of its incoming interpolation weights.
2026-11-22 19:48:29 +01:00
89c2d9ac12 Merge pull request #2309 from Faterek/asset-148-restofworld-textures
restofworld_index: identify embedded 0x980 textures and companion TTPF pools (ASSET-148)
2026-11-22 12:48:22 -06:00
18380c6d2b SHADER-537: bound M0-relative VGPR accesses 2026-11-22 21:48:06 +03:00
a8fae90809 Order the bindless table upload across queues, bound retired generations, keep the in-use set on failure (review of #2740)
Other queues' next submission waits on the timeline value of the submission that carries a new generation's table upload; the submit result is committed under tracker_mutex_; at most 8 retired generations are kept before the flush waits for the oldest one's ticket (queue timelines, not the device); a failed new generation leaves the in-use set and the pending writes alone. The churn test gains an async-compute case (no D3D12 fence from compute to the direct queue), a check that a retired generation is pending right after its submit, and a --validated ctest. Docs: only public sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:46:53 +01:00
8d19c7750d Translator: smaller f16 narrowing, same bits (SHADER-489)
In nearest-even mode the overflow select already maps infinity to 0x7C00, so
the separate infinity select goes. An f16 add/sub without omod is exact below
2^-14, so that range needs no rounding and no underflow select.

v_add_f16 goes from 47 to 31 SPIR-V instructions after spirv-opt -O, and
v_pk_add_f16 from 90 to 58. Checked equal on all 2^32 f32 inputs and all 2^32
f16 operand pairs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:46:04 +01:00
d3b74e99e4 rdna2spirv: s_incperflevel, s_decperflevel and s_wakeup are no-ops
They step a performance counter and ping s_sleep waves awake; none writes a register, memory, SCC, VCC or EXEC (RDNA2 ISA SOPP). Before, each raised Unsupported.
2026-11-22 13:45:44 -05:00
51f59d711d Merge buffer-formats-all-v2 (with main) into buffer-stores-rdna2
#2022 now carries main's SHADER-358 / SHADER-364, which did what the stores commit did for the three
older stores: f16 format stores toward zero (Gen.mem_f16), exact NORM rounding (Gen.encode_norm_bits)
and the DST_SEL-dependent routing of a two-component V# store (identity selectors: x, w; the runtime's
X,Y,0,1: x, y; tbuffer: x, y). This merge keeps their translator code, drops the duplicate encoders
(norm_encode_exact, the y-route flag) and what is left of this branch is: the 12 non-FLOAT
10_11_11 / 11_11_10 codes (Gen.FORMATS now holds all 77, gfx1036 validated them: @AwkGrep256, #2022),
the oracle (one store model per path, XY01 store runs, all 77 codes by default on a GFX10 device),
the larger cs_fmt_all fixture, and the docs.

Co-Authored-By: AwkGrep256 <AwkGrep256@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 19:45:42 +01:00
94a46f6311 meshlet_page: 42 40 slot-2 normals (octahedral 10+10 for type 1, 10:10:10 for type 7)
Checked against the summed face normals of the decoded positions (counts
only): 86.0% of 14.4M minigame vertices within 8 degrees, 1.5% opposed;
core_restofworld 66.3% / 11.3%, where 2% of groups are mostly inverted.
normals_4240 and normal_agreement, a --normals check, and docs/story.md with
the rule and the second-archive counts for positions, faces and centres.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:45:38 +01:00
d3b774eed5 PresentX planes: tone map shoulder, SDR white query off the present path, review fixes
- Tone map: identity up to 0.8 of SDR white, extended Reinhard shoulder above it, continuous in value and slope, content
  peak maps to 1.0 (SDR-range content is no longer darkened).
- The Windows SDR white level is read by a background thread (about once a second, only while HDR10 is in use);
  PresentX reads an atomic. A failed query keeps the last good value; QueryDisplayConfig retries on
  ERROR_INSUFFICIENT_BUFFER.
- LEONIDA_SDR_EOTF is case-insensitive, unknown or too long values are logged; setters are atomics; <cwchar> for wcscmp.
- Tests: eight-step HDR10 ramp with hand-calculated bytes, curve properties (monotonic, identity below the knee, peak 1,
  slope continuity), HDR10 plane 1 over SDR plane 0 on HDR10 and SDR outputs, hand-calculated 50% overlay bytes, query cost.
- Docs 4.5: shoulder description, query cost, sources marked (KWin claim unverified, vkd3d-proton file partly read, the
  measured 80 nits only covers the SDR fallback path).
- present_compose.inc rebuilt with glslc 2026.4 (reproducible, spirv-val clean).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:45:00 +01:00
7df62e56d9 vertex_types tests: build the skin blocks with a local helper; move the skin paragraph clear of the 0x21 one
Keeps this PR from conflicting with #2708/#2746 (which change block() and the 0x21 paragraph) and with
#2838: block() is unchanged, block_with_streams appends the extra streams before the group, and the
paragraph now sits before the slot-usage paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:44:48 +00:00
bd05e6ac7b docs/gameinput.md: FindDeviceFromId answers aggregate devices too
Review (@ramenbellic): aggregates live in the device list FindDeviceFromId
searches, with a fixed deviceId per kind.
2026-11-22 18:44:31 +00:00
b7bee40a9b docs/testing.md: keep the Wine prefix in the xvfb-run line, and name xauth
Review (@ramenbellic): the xvfb-run command dropped the WINEPREFIX of the block
above, so it ran in ~/.wine; and xvfb-run needs xauth, which minimal images
lack (CI installs both).
2026-11-22 18:43:54 +00:00
78c41f3135 rdna2spirv: reject mismatches in used VOP3 sources 2026-11-22 20:43:36 +02:00
be6498f3cc Merge origin/main ec8ec4c9 into proc-129-open-questions
Keep PROC-129's merged rows 19 and 20 and drop the copies reintroduced by
main. The open-questions table remains ordered and duplicate-free.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-22 19:43:28 +01:00
61ab2b1587 docs/models.md: what the effect-record ordinals index, the suffix counts over all graphics programs, the format as a hypothesis beyond three records
Answers @ramenbellic's review of 240180e7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:43:28 -03:00
079643ebfa ASSET-158: distinguish the census filter from reference indices
AI-assisted, verified against the original archive scan.
2026-11-22 19:42:53 +01:00
d83724030c Merge remote-tracking branch 'origin/main' into asset-158-fragment-bindings 2026-11-22 19:42:35 +01:00
ca570a4d2f fix(shader): select the typed array view for cube loads
The runtime binds cubes as 2D arrays. Fetching every cube as float gives integer textures a mismatched sampled type and clears a live upper half for odd D16 component counts.
2026-11-22 19:41:07 +01:00
1659d22e00 docs/design.md: one Scalar select and pack row again, with s_cmov_b64 supported
- the round-40 fix (ec8ec4c9) stitched the five s_cmov_b64-titled rows
  into one sentence by sentence: two Source:/CPU-checked groups, a
  pasted half-sentence fragment, and "**Not measured on RDNA2.**"
  right after the gfx1035 (SHADER-137) and gfx1036 measurements the row
  itself lists; the older row without s_cmov_b64 in the topic survived
  at line 335, so test_docs_design_rows does not flag the pair
  (self-sourced; found by @jayneebabageyus in issuecomment-7083604496
  while fixing PROC-132).
- keep one row with the s_cmov_b64 topic cell: the lane-mask rationale,
  the SOPInstructions.td source and the test_salu_cmov_b64.py CPU list
  from the pre-merge row (43f8e34d), the cs_w32_salu64/cs_w32_int_ext
  GPU-test naming (8564110a), the gfx1035 SHADER-137 and gfx1036
  int_hw_probe/salu_diff measurements (06f36cec, fe7edb58); the stale
  "Not measured on RDNA2." tail and the line-335 duplicate dropped.
- docs checks 4/4 green (11 tests).

AI-assisted.
2026-11-22 19:40:46 +01:00
dd506da33b Document subgroup capabilities for descriptor lookup 2026-11-23 00:09:30 +05:30
355e67cbc4 Merge remote-tracking branch 'origin/main' into perf/wave64-emulate-dead-scc-exec-fold
# Conflicts:
#	make_game.py
2026-11-22 14:39:18 -04:00
0c3774ab18 Merge branch 'perf/wave64-emulate-dead-scc-exec-fold' into perf/wave64-emulate-structured 2026-11-22 14:39:18 -04:00
f77d337315 anim_move: decode MoVE v19 state-machine containers in anim.rpf (ASSET-86) 2026-11-22 15:38:41 -03:00
496f5e47a4 Merge branch 'perf/wave64-emulate-dead-scc-exec-fold' into perf/wave64-emulate-structured
# Conflicts:
#	docs/design.md
#	tests/semantic/test_wave64_emulate_opt.py
#	tools/rdna2spirv.py
2026-11-22 14:37:04 -04:00
839e14dc1e Tests: seven host comparisons take their hardware reference on the layer's own adapter
d3d12_copy_xfmt, d3d12_depth_resolve, d3d12_fence_events, d3d12_indirect_zero,
d3d12_node_mask, d3d12_query_rules and d3d12_resource_desc created their hardware
reference with D3D12CreateDevice(nullptr), the default adapter, and did not read
LEONIDA_HOST_ADAPTER. On a PC with two GPUs the layer then ran on one GPU and the
host driver on the other.

runtime/test/host_adapter.h picks the adapter by the rule d3d12_copy_compare.h
already follows for d3d12_vulkan_device: the adapter LEONIDA_HOST_ADAPTER names
(a name that matches none fails the run; "warp" leaves the hardware pass out),
else the adapter behind the Vulkan device (deviceLUID), else the default adapter.
The tests print the adapter's name instead of "the default adapter".

Measured on a Ryzen 7 9700X iGPU (AMD 32.0.21042.62) next to an RTX 3070
(NVIDIA 610.74, the default adapter): d3d12_depth_resolve with the layer on the
Radeon set aside nine resolves as host quirks before and after, but four of them
were NVIDIA's ("D24S8 stencil as X24_G8"); against the Radeon's own driver the
four are D24S8 depth MIN/MAX. The other six tests print the same results against
either adapter.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:35:52 +02:00
640dec65f2 docs/textures.md: update stale BCPack gap title, Outcome table, and historical checklist 2026-11-22 10:34:40 -08:00
2426df3d5e GPU tests: wire cs_fma_fused in run_gpu_tests and accept GLSL Fma split on RADV 2026-11-22 18:34:11 +00:00
70c1c54cbf Merge origin/main into buffer-formats-all-v2
Conflicts in tools/rdna2spirv.py and docs/design.md. Main had meanwhile fixed three of the older
stores this branch found (SHADER-358: f16 toward zero; SHADER-364: exact NORM rounding and the
DST_SEL-dependent routing of a two-component format), so the merge keeps main's mem_f16,
encode_norm_bits and 2-component swizzle, applies them to the new SCALED kinds as well, and passes
the swizzled channels into the shared typed-store encode function (Gen.format_encode_call, now 29
parameters). Gen.norm_encode_exact and EXACT_NORM_CODES go: encode_norm_bits does the same job.
The three expectedFailure tests pass now and pin the older stores to the oracle's words; cs_fmt_all's
16_16_SINT store is (x, 0) through its identity-selector V#. design.md keeps one Typed buffer formats
row; test_buffer_store_format's unsupported-format example is BUF_FMT_INVALID (8_USCALED is
supported now).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 19:33:56 +01:00
80dd856a09 docs: drop the older cross-referencing BVH tally row
The newer row records the 42/52 re-measurement directly; the older row only pointed at section 4.8 and repeats the same claim one row below.
2026-11-22 19:33:48 +01:00