Commit Graph

5744 Commits

Author SHA1 Message Date
0a0e8182c9 rsc8_audio: the facial keyframes are anim_clips sequences; count them with --curves
docs/rsc8_audio.md listed the keyframe curves inside the RSC8 0x5c blocks
as undecoded. A packed block is one sequence of docs/animation.md (0x20
header, version 2, 11 channel types) and the track directory's constant
0x364D3BDB is joaat("facialtranslation"), so tools/anim_clips.py already
reads them. decode_facial_curves() hands a clip's blocks to that decoder
and --curves counts the outcome for every clip (counts only).

On one 1.0.2.1 package all 641,428 clips decode and 88,012,668 of
88,012,668 type-10 chunk boundaries close.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:38:09 +00:00
37ec81dac6 Allow cross-format texture copies into partial BC blocks 2026-11-22 21:36:59 +01:00
6e10c71304 design.md: drop the stale 'Not GPU-verified' from the 16-bit min3/max3/med3 row; name the all-NaN rows
The row says it is hardware-verified (gfx1036, and gfx1035 since) and then
'Not GPU-verified.' from before the measurement. The new all-NaN rows are named.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:36:12 +01:00
1b3a0d80f3 d3d12_xs: the device proxy answers IDXGIDevice1 (GetAdapter), step 3 of the GDKX boot sequence
A GDKX title asks its device for IDXGIDevice1, then GetAdapter and
EnumOutputs(0), to find the output it gives SetFrameIntervalX. The proxy
refused the QueryInterface, and a PC ID3D12Device has no IDXGIDevice to
forward to.

The proxy now answers IDXGIObject, IDXGIDevice and IDXGIDevice1 as one COM
object with the device (a second vtable pointer in the proxy, same reference
count and QueryInterface). GetAdapter and GetParent return the adapter of the
device behind it: the host DXGI adapter with the device's LUID on the host
backend, the layer's own rt::dxgi adapter on the Vulkan device
(set_device_outer installs that provider).

dxgi_device_test walks it on WARP, the first hardware adapter and the Vulkan
device.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:35:26 +00:00
bfe65cb90f embedded_shaders.md: one section 4 again after both PROC-120 PRs landed; the M6 row's count
The merge round took this PR's first commit and #2503, which say the same thing,
so section 4 carried both: the then/now table and, after a stray table row, the
bullet list and a second blocker table. Keep the table (now without 'open' after
#1864) and drop the repeat. d3d12_vulkan.md's M6 milestone row still said 42
pass and four rules left.
2026-11-22 21:35:25 +01:00
b62569d8e4 docs(i18n): sync Portuguese quickstart 2026-11-22 17:35:04 -03:00
6b8757ce3b docs: fix ray tracing, PSO stream and present wording in the D3D12 doc
Follow-up to the status update, after review:

- Status: ray tracing was lumped with mesh shaders as "not supported". The
  device does report RaytracingTier NOT_SUPPORTED, but
  BuildRaytracingAccelerationStructure (d3d12_com.cpp) builds XDXR BVH4
  structures on the GPU through runtime/src/xdxr_build.h, with a test
  (d3d12_xdxr_rt_test), as section 4.8 already says. Mesh shaders stay
  "reported as not supported". M1 and M1.5 are named next to M0, as the
  file already calls d3d12_draw_test M1 and d3d12_translated_draw_test M1.5.
- Section 3.6: it said pipeline-state stream subobjects "are both
  supported". CreateGraphicsPipelineState and CreateComputePipelineState
  are; CreatePipelineState (the stream) is not implemented.
- Section 4.5, "What exists": the DXGI shim's Present and PresentX were
  described as something that "would" end in the presenter. Both exist
  (shims/dxgi_com.cpp, shims/xbox_present.cpp). Section 3.2 now says that
  only which of the two the game uses is open (question 6).
- design.md: the Graphics folder cell uses backslashes like `tools\` in it.

Claimed in #3232. Written with AI assistance (Claude, via OpenBot).
Tested: python -I tests/test_docs_{design_rows,links,list_items,repo_paths}.py,
tests/test_i18n_index.py and tests/test_text_write_line_endings.py pass;
git diff --check is clean (Windows 11, docs only; no GPU involved).

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
2026-11-22 17:34:48 -03:00
b955277d43 meshlet_page: coarse_steps counts the w2 bit itself; story.md states the step rule once, with both steps (review) 2026-11-22 21:34:00 +01:00
5e1a7c85a5 docs: measure nested text archives in the minigame and rest-of-world packs
shared_minigame000.rpf: 78 tables in 13 nested archives, six each; the same 13 language order as data.rpf and story000.rpf, and 5 tables change language. story000_restofworld.rpf: 18 nested archives and no string table (0 of its 101 0DRP resources match the descriptor).
2026-11-22 20:32:49 +00:00
fafdeeec4a rdna2spirv: fix v_div_fmas_f32/f64 scaling to match RDNA2 gfx1036 hardware 2026-11-22 12:32:34 -08:00
507830e162 Document the legacy AMD typeless RTV test failure 2026-11-22 22:31:30 +02:00
a50a58bb13 docs/fssm_crosscheck.md: the duplicate XBCH payload bug is fixed, not open
#2479 added fssm_unpack.xdat_entries_all() and unpack(payload="first"|"last"), and the CLI's --payload, but this note still described the bug as open and cited a repro test that is no longer in the tree.

Correct the five spots that say so, and point at the tests that exist.
2026-11-22 15:31:27 -05:00
d5118c6006 Merge buffer-formats-all-v2 (round 41) into buffer-stores-rdna2
Conflict in docs/design.md only: main's Buffer format stores row kept (with the Typed buffer formats
suffix), this branch's Typed buffer formats row (all 77 codes) kept once.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:31:02 +01:00
787f025771 docs: pin the binary64 compare row to gfx1100, including NaN and signed-zero cases
All 16 v_cmp_*_f64 predicates match IEEE-754 for NaN, +-0.0 and +-inf operands, and v_cmpx_*_f64
narrows EXEC instead of writing VCC. 116 of 116 cases on native gfx1100.
2026-11-22 14:29:19 -06:00
71c02e9392 --fma exact: state the per-FMA cost precisely (instructions, NoContraction decorations, constants) 2026-11-22 22:29:18 +02:00
780a8770cf d3d12: log once when a texture or default-heap buffer spills out of device-local memory (D3D-299)
DeviceState::allocate takes the next memory type when device-local memory is
full, so on a 4 GB GPU a texture could land in system memory without a word.
leonida::spilled_to_host (vulkan_memory.h) says when that happened: the
allocation preferred DEVICE_LOCAL, needed no host access, and got a type
without it. The arena and upload heaps in system memory without Resizable BAR
are the memory type policy and are not reported. The first spill is logged
once, with its size, memory type and heap. Part of #2375.

# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
2026-11-22 21:28:35 +01:00
95f822d11b Add gdk_runtime_calls: list the runtime classes and slots an image calls through xgameruntime.lib
A title linked with xgameruntime.lib imports no GDK function: each thunk asks
QueryApiImpl (through a helper) for a class and interface, calls one vtable
slot and releases the object. tools/gdk_runtime_calls.py finds those thunks in
a PE without running it: the helper a known id's lea feeds, every call to it,
the class id in rcx and the interface id in rdx (unknown ids reported as such,
calls whose ids it can't read listed) and each slot called up to Release (CFG
dispatch, call [r+disp8/disp32], any vtable register, register copies
followed), scoped by .pdata or a byte window. Slots are named from
tools/gdk_runtime_classes.json (ids, inheritance and method order of
xgameruntime-docs, GPL-3.0, facts only; made by
tools/gen_gdk_runtime_classes.py). The report flags classes
runtime/shims/xgameruntime.cpp serves, estimates argument counts, says whether
anything in the image reaches each thunk, and lists known ids no thunk uses.
Text by default, --json, --out DIR.

Measured on the package: XCurl.dll and the four classes read by hand in
libHttpClient.GDK.dll match the slots in docs/runtime_imports.md.
libHttpClient holds the ids of 23 of the 24 documented classes (not
XGameActivationImpl's) and thunks for all 23, but is incrementally linked and
references only 15 of its 404 thunks (XThreadingImpl, XErrorImpl); the
module table now says so instead of "24 of 24, five called through thunks".
scripts/first_look.ps1 runs the tool on the executable, and the day-one
checklist in docs/design.md points at its report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:28:05 +00:00
5109c6b804 docs: escape the stray pipes that split contract-table rows, and check their shape
Eighteen rows of the translator contract table in docs/design.md carry four to
thirteen cells against a three-cell header, because a rule that writes a literal
pipe (the `|v|`, `-|v|` source-modifier list, `a | b` in a flag summary) leaves
it unescaped. GitHub reads each one as a separator: the row renders into columns
the header does not have and the tail of the rule is dropped, so the page loses
text instead of failing.

Escaping them as `\|` restores the row; every changed line differs from main only
by inserted backslashes (checked line by line, nothing else moved). The table
check in tests/test_docs_design_rows.py now also rejects a row whose cell count
differs from its header's, on either of the three pages it already covers, so the
next merge that drops a rule with a pipe in it is caught rather than rendered.
2026-11-22 14:27:49 -06:00
d07396a04f docs: f16 narrowing row covers the bias and the single MODE pass
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:27:49 +01:00
68804c6f8f feat(rdna2spirv): implement v_dot2c/4c/8c and v_dot2_f32_f16/v_dot2c_f32_f16 2026-11-22 22:27:46 +02:00
cf73f5b8a3 docs: update the D3D12 -> Vulkan layer status
docs/d3d12_vulkan.md said root signatures, PSOs, draws and the game's own
present entry point were not implemented, and docs/design.md said the D3D12
layer was still to do. The shims already have all of these:

- root signatures: CreateRootSignature parses RTS0 and packs it into the 32
  user-data dwords (d3d12_vulkan_device.cpp);
- graphics and compute PSOs: CreateGraphicsPipelineState and
  CreateComputePipelineState;
- draws, dispatches and ExecuteIndirect: d3d12_com.cpp, replayed in
  vulkan_replay.h;
- present: PresentX (xbox_present.cpp) and a DXGI swapchain (dxgi_com.cpp),
  with ctest tests d3d12_draw, d3d12_translated_draw, d3d12_present,
  xbox_present and dxgi_swapchain.

Still not done, and now said so: shader-resource views of buffers (refused),
CreatePipelineState (pipeline-state streams, a generated stub), hull/domain
and stream-output pipelines (E_NOTIMPL); mesh shaders and ray tracing are
reported as not supported. Which present path the game uses stays open.

Claimed in #3232. Written with AI assistance (Claude, via OpenBot).
Tested: python -I tests/test_docs_{design_rows,links,list_items,repo_paths}.py,
tests/test_i18n_index.py and tests/test_text_write_line_endings.py pass;
git diff --check is clean (Windows 11, docs only; no GPU involved).

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
2026-11-22 17:27:31 -03:00
5d62a2ca9e Merge origin/main into shader-579-barrier-counters
Conflicts: fit_shared_memory (main now shrinks to the RSRC2 allocation
with bounds-checked LDS; kept that, still without the 12 bytes when the
barrier-round count goes into the LDS) and docs/design.md (main's rows,
with the SHADER-579 references and row re-applied).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:27:10 +01:00
6f66c4b5aa d3d12: CreateRootSignature registers the root signature's static samplers
The Vulkan device parsed a root signature's static samplers and dropped them,
so a shader holding one's S# by value missed in the hash table and sampled
through the fallback sampler. Each one now gets a sampler in set 0 and a key in
the hash table at root-signature creation, encoded as CreateSampler2 encodes
the same description (1.0, 1.1 and 1.2 blobs, the static border-colour enum,
the 1.2 flags).

d3d12_descriptor_test checks the key before and after for four root
signatures and samples with three of them on the GPU. docs/d3d12_vulkan.md no
longer says both that they are registered and that they are not.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:27:04 +00:00
fade4e4b98 rdna2spirv: cull an empty BVH box (min > max) instead of traversing it 2026-11-22 14:26:56 -06:00
b5678887f8 docs: pin the LDS inc/dec/rsub and float min/max atomics row to gfx1100
ds_inc_u32 stops at DATA, ds_dec_u32 stores DATA instead of wrapping down, ds_rsub_u32 wraps, the
_rtn_ forms return the pre-op word, and ds_{min,max}_f32 take the non-NaN operand with -0.0 below
+0.0. 28 of 28 cases on native gfx1100.
2026-11-22 14:26:34 -06:00
f324bfbc71 Merge upstream main into SHADER-537 2026-11-22 23:25:25 +03:00
2c9b8620bd shader_disasm: end the code range before a trailing constant-data block
Blobs can end with s_endpgm, a dword count N, N dwords of data and a closing s_endpgm. The data was disassembled as code, so llvm-mc reported invalid words.
2026-11-22 15:25:17 -05:00
15b230aea2 docs: drop stray duplicate fma_mix result rows
Two rows were appended after the prose with no table header; the same results are already in the table above.
2026-11-22 21:24:36 +01:00
4ae614f4cf docs: drop the duplicated open-question 19 row
The same question and answer were appended twice to the table; keep the first one.
2026-11-22 21:24:35 +01:00
4ef5016aca docs/design.md: the ImposterShadow inf/NaN doesn't reproduce; oracle-checked (TEST-643)
Both PS_ImposterShadow variants are the same nine-instruction body whose red is
v_cvt_pkrtz_f16_f32(v2, 1.0), and v2 is POS_Z_FLOAT (gl_FragCoord.z), so red is
f16(depth) and can't be inf or NaN. Redrawn on an AMD gfx1036 iGPU and an RTX 5090
(0 inf, 0 NaN, bit-identical), and the raw body run through #3061's pixel-shader
oracle on the iGPU matches the translated output bit for bit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:24:17 +01:00
58226b459c Seed runtime Vulkan pipeline cache from offline builds 2026-11-22 21:24:02 +01:00
536e987681 Merge origin/main (round 41) into buffer-formats-all-v2
Conflicts in docs/design.md (main's Buffer format stores row kept, the "and the formats of the
Typed buffer formats row" suffix and the Typed buffer formats row added once) and
tests/test_shader_checks.py: TOTAL counts main's 12 fixtures (three mesh, ps_tex, ps_imgatomic, five
compute, ps_ssharp, vs_base_ids) plus cs_fmt_all, so + 13.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:23:18 +01:00
575a49b029 page_index: keep q28 records after a null pointer; whole-archive counts for page_directory.md
_q28 stopped a +0x28 table at the first record whose pointer is not
0x50000000-based. Over all of anim.rpf that is a zero pointer on 3,672
records (3,511 of 22,823 pages), and 116,277 ordinary records after them
were left out of the report. Such a record is now kept with target null
and the table is read on; any other non-base pointer still ends it.

A q28 table that ends past the streams read for q38 (1,355 anim.rpf,
225 navmeshes.rpf, 1 data.rpf pages) came back empty with no reason; it
now says so in q28_error. The summary gains q28_declared,
q28_null_targets and q28_tables_unread.

docs/page_directory.md: navmeshes.rpf and anim.rpf read to the end
(9,603 and 22,823 pages) next to the 64 MiB / 256 MiB samples, with the
header ranges and the two q28 statements the samples did not show.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:22:59 +00:00
f1bd00ae47 Merge remote-tracking branch 'upstream/main' into devin/1795886000-interp-mov-p10-p20
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	docs/design.md
#	tools/rdna2spirv.py
2026-11-22 20:22:38 +00:00
8128b411a9 Merge remote-tracking branch 'origin/main' into devin/1795373985-design-med3-stitch
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	docs/design.md
2026-11-22 20:22:16 +00:00
52aebe56ca Merge remote-tracking branch 'origin/main' into devin/1795375558-design-merge-leftovers
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	docs/design.md
2026-11-22 20:22:01 +00:00
6de779367b Runtime: command allocators and lists answer invalid arguments as the host does
Measured against the host D3D12 runtime (RTX 5070, driver 621.14) with
d3d12_vulkan_device_test's compare_invalid_arguments:

- CreateCommandAllocator and CreateCommandList1 took any type (7, 99,
  -1); the host refuses types past VIDEO_ENCODE with E_INVALIDARG.
- CreateCommandList and CreateCommandList1 took a node mask with bits
  past node 0; the host answers E_INVALIDARG.
- A null output was E_POINTER in all three; the host answers
  E_UNEXPECTED, after the argument checks.

compare_invalid_arguments gets 35 "command allocator:", "command list:"
and "command list1:" cases. Video list types are not compared: the host
hands out a video list (E_NOINTERFACE for ID3D12GraphicsCommandList),
while this layer creates a graphics list for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:21:25 +01:00
056661d125 xgameruntime: serve XUserImpl (offline local user) through QueryApiImpl
A GDK title links the XUser* functions statically (xgameruntime.lib); each
thunk asks QueryApiImpl for XUserImpl and calls one slot with the function's
arguments after `this` (docs/runtime_imports.md). QueryApiImpl refused the
class, so XUserAddAsync, the call a title makes at boot before nearly
anything else, could not succeed.

runtime/shims/xgameruntime_user.cpp serves it, in its own file so the other
class PRs touching xgameruntime.cpp only meet it at one line:

- ids and slot order from xgameruntime-docs (facts only), signatures, enum
  values and E_GAMEUSER_* codes from the public GDK reference;
- IXUserImpl..IXUserImpl6 answer with one 50-slot vtable, IXUserGamertagImpl
  (XUserGetGamertag) with a second;
- one offline user, always signed in: XUserAddAsync (silent or not;
  AllowGuests with AddDefaultUserSilently is E_INVALIDARG), fixed ids,
  FindUserById/ByLocalId, Duplicate/Close/Compare, not a guest, adult, every
  privilege, ResolvePrivilegeWithUi, AddByIdWithUi, IsStoreUser, change-event
  tokens; gamertag from LEONIDA_GAMERTAG, "Player" otherwise;
- tokens, gamer picture, MSA tokens and resolve-issue fail synchronously
  before starting; no sign-out deferral; private and PC-only slots log once.

xgameruntime_user_test (40 checks) drives every served slot; a second ctest
run checks LEONIDA_GAMERTAG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:21:21 +01:00
ae2f7bf6d3 xgameruntime: serve XPackageImpl (IXPackageImpl3) through QueryApiImpl
libHttpClient.GDK.dll asks QueryApiImpl for XPackageImpl with IXPackageImpl3's
id through 30 thunks (slots 3-19, 22, 24-27, 30, 32-34, 37-40), each in
the argument shape of the method at that position of xgameruntime-docs'
IXPackageImpl (3-34), IXPackageImpl2 (35-38) and IXPackageImpl3 (39-40)
lists, e.g. 10 (monitor, token, bool), 14 (id, count, selectors), 24-26
the mount path trio, 39 (kind, scope, context, callback).

Slots with an offline answer forward to the XPackage functions already
on main, so the vtable and the named exports agree: 3 the package
identifier, 4 packaged process, 25 the mount path; plus 11 the host user's
locale, 24 the mount path size (exactly what 25 needs) and 26 closing a
mount (nothing to release). Every other slot logs its number once and
returns E_NOTIMPL, so the first boot lists what the title needs.

xgameruntime_test +6 (80): the IXPackageImpl3 id, 3 and 4 equal the
exports, the locale and its short-buffer error, 24/25 sizes, 5/40 stubs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:20:50 +00:00
b5e9ca4ccc Runtime: expose conservative rasterization Tier 2 with capability gates 2026-11-22 16:20:44 -04:00
b21c38e1d2 Merge origin/main into fix/shader-427-structured-depth
Conflicts: tools/rdna2spirv.py (--pc-tail-ubo and --max-structured-depth
both added next to --max-shared-memory: kept both) and docs/design.md
(upstream reworded the neighbouring rows: kept theirs and re-applied the
SHADER-427 sentence of the "Control flow" row).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:20:40 -05:00
b000451dc9 docs(testing): record the RDNA1 RADV s_bfe_i64 limitation (SHADER-276) 2026-11-22 20:20:33 +00:00
5ae8c0b2b3 Document bloom and exposure shader inputs 2026-11-22 22:20:13 +02:00
37e6d48286 Tests: the host GameInput.dll path from mapped code
docs/gameinput.md says that without the SDL3 shim the loader binds
GameInputCreate to the host's GameInput.dll, but nothing tested it.
gameinput_host_test maps a CRT-free fixture DLL built against the SDK's
gameinput.lib and checks that the import binds to the host copy (the test links
no shim table), that GameInputCreate and GetCurrentTimestamp work from mapped
code, that GetCurrentReading answers, and, with a pad attached, that
GetGamepadState succeeds. It skips (77) where there is no GameInput.dll, and is
only built when gameinput.lib is found.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:20:03 +01:00
9f9f75d048 rdna2spirv: read 64-bit immediates in s_ff0/s_ff1_i32_b64 via src64_data 2026-11-22 21:20:01 +01:00
d4dfcea7bd fix(tools): inline_scan exits 2 when it reads no instructions
An empty file, a text file that is not a dumpbin listing, or a PE dumpbin
prints no code for gave "list sites 0: checked 0, UNCHECKED 0" and exit 0,
the same as a clean image. The scan now counts the instructions it reads,
prints the count, and exits 2 with a message when there are none.
2026-11-22 20:19:45 +00:00
99c048f7fd rdna2spirv: fix 32-bit bitwise SALU ops on wave32/wave64 lane masks 2026-11-22 21:17:49 +01:00
422ca90979 Merge pull request #3327 from Kam471 2026-11-22 15:17:00 -05:00
c6341775fb Merge pull request #3321 from HAMADA 2026-11-22 15:16:57 -05:00
a66a71ffd3 Merge pull request #3318 from pmilewsskiedu-gif 2026-11-22 15:16:55 -05:00