Commit Graph

5744 Commits

Author SHA1 Message Date
f9a597657b docs/design.md: the census idiom counts are tags on any tier, not tier B shaders
Review of #3570: wave64_halves.py census() sums the idiom tags over every
analysed shader, tier C included, so 626 + 287 + 35 tags sit next to 85
tier B shaders. Say what the numbers count.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 21:25:11 +00:00
948cc66afb docs/gamedata: scope InteriorNames position bounds comparison to x/y extent 2026-11-22 18:24:49 -03:00
f66b0d6b60 docs/gamedata: document damage, tuning, combat, ped, and world XML families 2026-11-22 18:24:48 -03:00
2a7c72ff7b docs/design: f16 interpolation row, colliding decoded-half locations are repacked, not rejected
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 21:24:41 +00:00
44b1242336 rdna2spirv: pack v_lerp_u8 byte arithmetic (SHADER-695) 2026-11-23 00:24:29 +03:00
30e676038b build: stop pipeline batches on native setup failures (BUILD-1030) 2026-11-22 18:24:03 -03:00
20daca0435 docs/gbuffer: clarify OSG1 vs FSSM +0xFC, 1702/1703 counts, and RTZ truncation vs rounding 2026-11-22 18:23:58 -03:00
5122533e59 docs: document deferred G-buffer layout and declared output signatures (PROC-146) 2026-11-22 18:23:57 -03:00
f4e50d6cf2 PROC-185: drop the duplicate GameInput API rows
docs/gameinput.md listed IGameInputDevice and IGameInputDispatcher twice with contradicting cells. Keep the rows that match runtime/shims/gameinput.cpp: force feedback and haptic motors are implemented, and Dispatch runs its quota; drop the stale duplicates.
2026-11-23 02:23:32 +05:00
1f81022095 tools: isolate fuzzer work output per run 2026-11-22 23:23:06 +02:00
f574359675 bvh_gpu_smoke: check PrefixSum64's exclusive scan and block total
One group scans 64 words in place through five ds_swizzle_b32 broadcast steps;
the check feeds input that wraps past 2^32 and compares every element and the
total. Passes on an RX 9070; with ds_swizzle_b32 skipped it fails from element 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:23:01 +00:00
3169652e94 bvh_gpu_smoke: --checked compares five programs' output byte for byte
RadixReset, ResetKDOP, ResetToIndexBuffer, CopyCounters and ResetCounterValues
take an address, a count and a value or source from the root table and write
that many entries; --checked gives them those fields and compares every entry
and the untouched bytes after them. All five match on an RX 9070; with the
translator made to skip v_add_nc_u32, ResetToIndexBuffer fails the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:21:02 +00:00
51cc9e6dcb docs/design: drop three more repeats in the pack_b32_f16, f16 interpolation and approximations rows
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 21:20:40 +00:00
48cee7c2c6 Queue holds: second review fixes (claim after submit, presenter locking and bound, teardown pump, tests)
- A Signal counts as submitted only after vkQueueSubmit succeeded: a failed submit releases no waiter and the retry goes through.
- ~VulkanQueue pumps after dropping held work; fence keep-alives are also drained in wait() and marker().
- VulkanPresenter: counters are atomics, read_back/enable_capture take the presenter mutex, set_abort has its own mutex,
  a deferred present reports not tearing, and at most 8 presents queue up before the caller waits.
- Tests: three presents (blit, blank, composed) queued behind held work run in order, a present behind a destroyed
  queue's held work runs, a failed Signal does not release its waiters; the handover modes also run on the host runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:20:36 +01:00
0f83451af9 gta6rt: the offline WinHTTP stub passes a handle's context value to its children
make_handle copied the parent's status callback and notification mask to
a new handle and left its context at 0. The host's winhttp.dll also
passes WINHTTP_OPTION_CONTEXT_VALUE on: a connection and a request start
with the context their parent has when they are made, WinHttpQueryOption
returns it and their HANDLE_CREATED and HANDLE_CLOSING callbacks carry
it. A context set on the handle itself, or given to WinHttpSendRequest,
still replaces it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 00:19:59 +03:00
e9e907e06e docs(i18n): restore Linux quickstart sections 2026-11-22 18:19:10 -03:00
7353b6fbdd Merge branch 'radv-ps-oracle' into ps-helper-lanes
# Conflicts:
#	docs/design.md
#	docs/shader_validation.md
2026-11-23 00:18:06 +03:00
1fc162f4ba gameinput: track which kind of device the player used last
The shim tells the title every pad is an Xbox One pad, so nothing could
say what the player is really holding. rt::gameinput::active_input()
now returns the family of the device used last (Xbox, PlayStation 5,
PlayStation 4, PlayStation 3, Nintendo, or the keyboard pad), a
generation that counts changes, and whether LEONIDA_PROMPTS forced it.
It is groundwork for button prompts that follow the device in use.

Only deliberate input counts: a button going down, a trigger past 0.3
or a stick leaving a 0.35 radius. Held input, stick drift and noise do
not; a pad's first reading after it connects is its baseline; and
after a change the next one waits LEONIDA_PROMPTS_SWITCH_MS (300 ms).
The rules live in runtime/src/active_input.h with no SDL, tested by
active_input_test; gameinput_test drives them on SDL virtual pads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:17:56 +00:00
cac7fe25cf tex_headers: address review comments on pointer tags, JOAAT name mapping, and mip layout
- tools/tex_headers.py: read mips from flags at +0x42 (flags >> 16) and preserve b6 at +0x3e.
- tools/tex_headers.py: validate system pointer tag (0x5...) and reject null pointers so all-zero buffers produce empty records.
- tools/tex_headers.py: match texture names by lowercase JOAAT32 hash rather than index position.
- docs/textures.md: wrap lines under 118 chars and label dry cell occupancy as hypothesis.
- tests/test_tex_headers.py: add tests for differing b6/mips offsets, zero buffers, invalid tags, reversed and missing names.
2026-11-23 00:17:56 +03:00
960466152f Merge branch 'pr3061-new' into radv-ps-oracle
# Conflicts:
#	docs/shader_validation.md
2026-11-23 00:17:29 +03:00
65834632dc docs: how the IDL and xgameruntime-docs layouts of the runtime classes compare
The Wine-derived IDL matches xgameruntime-docs exactly where the docs list no
unknown slot (XGameSave, XGame, XStore), keeps one unknown as __PADDING__
(XError), and drops others (XUser slot 15, XDisplay slot 3), which shifts every
later method. Note it next to the measured layout table, so a layout taken from
the IDL is checked against the docs' slot count first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:16:46 +00:00
14c5b93ff7 Merge remote-tracking branch 'origin/main' into feature/asset-274-textures-rpf 2026-11-23 00:16:19 +03:00
b24f2ce9cf rdna2spirv: fix TwoSum overflow in Gen.f64_add_mode via FastTwoSum 2026-11-22 23:16:08 +02:00
a41173a1ae Tests: gameinput_host fails instead of skipping when GameInput.dll is present (review)
- gameinput_host_test decides the skip before mapping: LoadLibraryExW of GameInput.dll from System32. Only "not found"
  skips (77); an import that then binds to nothing is a failure. Breaking host ordinal binding in Loader::resolve now
  fails the test (4 failures) instead of skipping.
- The gameinput_host fixture links in Debug: /RTC1 with /NODEFAULTLIB left _RTC_InitBase, _RTC_Shutdown and
  _RTC_CheckStackVars unresolved, so the fixture defines them as no-ops when runtime checks are on.
- The fixture reports E_FAIL, not S_OK, when GameInputCreate fails, and the test counts a gamepad as attached only when
  the library was created.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 22:15:41 +01:00
dac28e6b19 Fix what the round-42 merges broke (tests and docs)
- shader_disasm: prune stale listings against every input, not the --skip-existing remainder (a resumed run
  deleted every listing it had just reused).
- progress_dashboard: a drive-letter path is never inside the repository off Windows (it printed user names);
  its own read_text helper is read_utf8, so the encoding check does not take it for pathlib's.
- Translator tests follow this round's rules: desc_lookup's BroadcastFirst in the typed-load condition walker;
  resinfo sizes are 0 past the last level and a 2D depth word is 0 (SHADER-388); SHADER-315 constant folding in
  the perm and i16 tests; #2089's structured wave64 emulation.
- test_semantic_translator_use: 57 oracle-only files merged before it are DEBT; test_spirv_tools_required is
  allowed (CI meta-test).
- Test fixes: image_fuzz fake writes the programs, preflight follows c506d00c's loader hint rule, feature_scan
  reads the first line of a pytest-decorated message, w64_graphics wording.
- docs: rows merged again in design.md, README.md, d3d12_vulkan.md; GameInput table rebuilt from #3172's rows;
  orphan rows in models.md and embedded_shaders.md; repeated bullets; anchors; a flag not on main.
- Repo rules: stdout guard on 14 programs; LF writes; csv lineterminator in bink_play.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:14:54 -05:00
2e3443608c Document verified exposure history inputs and bloom weights 2026-11-22 23:14:51 +02:00
2cf4a8e224 docs/design: drop stale not-verified markers where hardware evidence exists 2026-11-23 00:14:07 +03:00
58bc80c331 tools: ps_helper_probe.py measures helper lanes at a triangle edge on RDNA2 (SHADER-681)
docs/design.md's whole-quad-mode row left helper-invocation behaviour at
triangle edges untested. The probe draws a triangle whose edge cuts 2x2
quads and runs seven wave64 raw-ISA pixel shaders through ps_oracle;
covered lanes read their helper neighbours through DPP quad_perm.

On gfx1036 (RADV, Mesa 26.3.1) all 10 checks hold: entry EXEC is the
covered pixels, s_wqm turns on exactly the quads with a covered pixel
(packed from lane 0), lane % 4 = (x & 1) + 2 (y & 1), helpers
interpolate their own pixel centre, their v0/v1 hold their own I/J
before s_wqm, and an exp vm with helpers on writes no pixel outside the
triangle. The design.md row now says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:13:40 +03:00
933c323948 docs: XGameImpl in the runtime class layout table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:10:59 +00:00
4e001c0665 docs/d3d12_vulkan.md: each milestone row once, the current one
Section 6's milestone table had M2, M3, M6 and M7 twice each, an older row
next to the one that replaced it, left by merges. The two M6 rows disagreed on
the BVH builder's FSSM programs (42 pass with four rules left, or 51 with one).
Kept: M2 with the d3d12_m2_formats results, M3 with the single-output
occlusion probe (D3D-209, as the text under the table says), M6 at 51 of 52,
and M7 with plane compose done (#2069). Dropped the older copies.

tests/test_docs_table_ids.py fails when a Markdown table names the same bold
ID (`**M2**`) in two rows. Tables keyed by plain values repeat them on purpose
and are not checked. It fails on main f847748c and passes here.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:10:14 -06:00
4d65bae6b2 rdna2spirv: run DPP's ballot and shuffle in every lane under SPIRV-Cross (SHADER-529)
SPIRV-Cross (MoltenVK) inlines a single-use result into the expression that
uses it. The DPP lowering put the source-EXEC ballot on the right of an
OpLogicalAnd (a short-circuiting && in MSL) and the shuffle in the arm of a
scalar OpSelect (a ternary), so lanes out of their row skipped the ballot and
the shuffle read from lanes that never ran it: row_shr:1's lane 1 found lane 0
inactive and kept its old value (cs_dpp_ops on MoltenVK).

Both results are now stored to a Function variable of their own (Gen.eager)
and loaded back; a store is a statement every lane runs. Only the DPP path
changes: of the 217 GPU test shaders that assemble here, exactly the nine
cs_dpp* ones translate differently, all still pass spirv-val, and SPIRV-Cross
1.3.239's MSL now computes the ballot and the shuffle as their own statements.

tests/semantic/test_dpp_eager_subgroup.py models SPIRV-Cross's single-use
forwarding and fails on the old lowering for all 11 DPP16/DPP8 forms tested;
it also checks the values in spirv_wave_interp.py against a DPP reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GN11jbD4AeqgwR5C5Z5Xs9
2026-11-22 21:09:28 +00:00
df81938499 Label BCPack Outcome column as projected, account for 17/5,167 BC7 refusals, and update design.md TTPF row 2026-11-22 13:08:55 -08:00
5f4812c86d docs/design: remove merge leftovers in 7 contract rows
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 21:08:55 +00:00
f38d56832a docs/textures.md: update stale BCPack gap title, Outcome table, and historical checklist 2026-11-22 13:08:23 -08:00
9be689c67f navmesh_decode: Band-3 grid keys are linear octree keys, inner nodes hold 0xff00 (ASSET-287)
--deep now checks that every grid key is a sentinel-bit octree key (root 1,
child = parent << 3 | octant, every parent present) and that every inner
node's u32 word is 0x0000ff00, and reports key depths, the inner-node count
and leaf words by low byte. docs/navmesh.md records the measured layout;
the x/y order of octant bits 0/1 and the leaf fields' meaning stay open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:08:13 +01:00
9043bb967d Use relaxed OpAtomicLoad for float atomic CAS seed and document MODE.denorm32 subnormal behavior 2026-11-22 13:08:06 -08:00
6c6a258a0b rdna2spirv: enforce atomic natural alignment and add buffer_atomic_{fmin,fmax} 2026-11-22 13:07:51 -08:00
e4617613e7 build: bound pipeline checks and recover collective crashes (BUILD-1030) 2026-11-22 18:07:48 -03:00
8ef0f2c01d docs: correct the ASSET-279 model key width 2026-11-22 22:07:45 +01:00
6d458e4b05 bvh_gpu_smoke: run XboxBvhBuilder's translated programs on the GPU (TEST-594)
tools/bvh_gpu_smoke.py translates the 52 embedded programs from the package
(the pipeline docs/embedded_shaders.md documents) and runs each through
vk_compute_test twice, with a root table seeded by VKC_HEAP_INIT whose words
point past it into zeros. A run passes when it exits 0, the validation layer
reports nothing and both runs write the same heap bytes. On an RX 9070 all 49
non-rehydration programs pass; seven change heap words with these inputs.

The wave64 bitonic sorts need --max-shared-memory set to the device's 32 KiB;
docs/embedded_shaders.md records the run and what it does and doesn't show.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:07:38 +00:00
dc8827151d Trace auxiliary draw bindings and join short system pages 2026-11-22 23:06:30 +02:00
467660963d d3d12: a placed resource reports its heap's flags as they are
d3d12_heap_properties_test compares what ID3D12Resource::GetHeapProperties
returns on the Vulkan-backed device and on the host runtime: the properties
and heap flags of committed resources in every heap type (custom ones and
SHARED, ALLOW_DISPLAY, CREATE_NOT_ZEROED, CREATE_NOT_RESIDENT included), of
placed resources in heaps of each kind, and of reserved resources, with null
arguments too, and whether each call wrote its outputs: 561 values. On main 4
differed (RTX 3060, driver 610.88), all the same rule: a placed resource
reports its heap's flags as they are, so one in an ALLOW_ALL heap reads back
0, while the layer added the DENY bits of the resource classes it isn't (0xC0
for a buffer, 0x44 for a texture). Those bits are the runtime's choice only for
a committed resource's implicit heap, where the layer already matched.

Builds on #2864, which adds the placed_ flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:06:27 +01:00
f0a6adb034 tools: decode navmesh +0xB8 paired obstacle footprint records (ASSET-281) 2026-11-23 00:05:42 +03:00
ca028b50c0 Identify story000.rpf as the measured q38 export source 2026-11-22 22:05:21 +01:00
3e70baa099 d3d12_residency_test: a child that can't run its step fails the test
From the review on #2864. The exit code a host-step child gives when it
couldn't run its step (kNoChild, 0xC41DFA11) fell into the crash-status mask
and counted as a host fault, so a broken child path would have left those
steps "not compared" and passed. It is now checked first and fails the test,
and the values left out may not exceed the 11 measured (the nine null-pointer
steps the host faults on and the backwards fence twice), so the comparison
can't go vacuous. The summary and docs now say 58 steps and 110 values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:04:47 +01:00
173ce07977 d3d12: residency calls answer as the host runtime does
d3d12_residency_test runs the same 110 MakeResident / Evict /
SetResidencyPriority / EnqueueMakeResident steps on the Vulkan-backed device
and on the host runtime, with a committed buffer, a heap, a placed buffer, a
descriptor heap, a query heap and a fence of each. It compares every HRESULT,
the device-removed reason after each step, and the value EnqueueMakeResident
leaves the fence at. Steps that leave the host runtime unusable run there in a
child process with a fresh device (--host-step). On main 7 steps differed (RTX
3060, driver 610.88); now none do:

- SetResidencyPriority takes a priority only for objects that own their
  memory, committed resources and heaps. A placed resource (a reserved one too,
  by the same rule; not measured), a descriptor heap, a query heap or a fence is E_INVALIDARG, also inside a
  longer list (the layer accepted all of them). The host also removes its
  device then (DXGI_ERROR_INVALID_CALL); the layer doesn't, since a title that
  sets priorities on placed resources would lose its device over a hint.
- EnqueueMakeResident accepts a null fence and signals nothing (the layer
  answered E_INVALIDARG).

Not compared: a nonzero count with a null array and a null entry in an array,
which the host dereferences; and a value below the fence's current one, which
moves the host's fence back but not the layer's (Vulkan timelines only go up,
already documented).

d3d12_vulkan_device_test's residency checks expected the old answers for a
fence and an allocator's priority and for a null fence, and now expect the
host's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:04:47 +01:00
bff06eacbb spirv_gs_to_compute: guard OpEmitVertex on n < OutputVertices (SHADER-617) 2026-11-22 13:04:45 -08:00
7e0809fcbc docs: the Home Sweet Home song is in audio.rpf as loop stems (PROC-178)
The mission-music section said the song audio is not in 1.0.2.1. @jefftern4
found it in the plain audio.rpf bank at 0x300695000: 73 stereo Opus streams,
47 of them 771,213 samples long, stems that play together, so no single
stream matches. Record the bank's shape (counts and lengths only), point the
all-banks coverage row at it, and replace the residual-uncertainty note with
what is still open: how the game sequences the stems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:04:32 +01:00
d92f199c07 rdna2spirv: normalize binary64 subnormals in v_frexp_{mant,exp}_f64 (gfx1036 measured) 2026-11-22 13:04:18 -08:00
96830e58f2 dxgi: keep BufferCount at the app's request when Vulkan's native count differs (D3D-389)
Vulkan may return more images than minImageCount, and caps.minImageCount can exceed the requested count, but GetDesc/GetDesc1 must report the app's BufferCount and GetCurrentBackBufferIndex must stay inside it.

When the native count differs, expose a stable offscreen ring of exactly the requested size and blit the current slot into the acquired native image at present; direct native mapping is unchanged when the counts agree. Add a fake-Vulkan regression test (extra native images, min above request, request above min) and DXGI-level desc/index assertions.
2026-11-22 21:01:27 +00:00