Commit Graph

4220 Commits

Author SHA1 Message Date
84347bbb61 Merge pull request #24 from ddddddddwp/fix/shader-1264-exec-computed
rdna2spirv: a computed value written to EXEC sets the lanes of its bits (SHADER-1264)
2026-11-23 21:37:41 -05:00
e6ca5cb29e Merge pull request #19 from moffington/contrib/pipeline-library-upstream
Add slot-67 pipeline-library shader build and runtime loading
2026-11-23 21:27:26 -05:00
642880a217 shaders: translate pipeline library in parallel and align clash/doc details 2026-11-23 21:20:34 -05:00
d8db7715c7 docs/shader_validation.md: salu_diff has 117 opcodes in OPS and draws from 104 by default 2026-11-24 07:31:31 +05:30
51c61df441 docs/README.md: the fspx row gives 20 of 29, the latest count in fspx.md 2026-11-24 07:31:20 +05:30
0e87fa3fb5 docs/design.md: the pc-tail-ubo row drops its stale shader counts; the GPU test programs bind the block, the D3D12 layer does not yet 2026-11-24 07:31:19 +05:30
b7fb698e51 docs: clarify the default salu_diff opcode pool 2026-11-24 07:30:17 +05:30
be64e8c7af docs: salu_diff generates 99 opcodes by default; v_pack_b32_f16 abs is implemented (#5519, #5517) 2026-11-24 07:30:17 +05:30
1b15cd2316 rdna2spirv: a computed value written to EXEC sets the lanes of its bits (SHADER-1264)
`s_lshl_b32 exec_lo, 1, s5`, `s_add_u32 exec_lo, ...` and `s_bfm_b32 exec_lo, ...` reached EXEC
through the generic SALU destination path, which tested the value for non-zero. A computed
32-bit value is not a lane mask: lane L takes bit L of it, so `s_lshl_b32 exec_lo, 1, s5` sets
lane 3, not all 32.

Gen.exec_bit takes that bit, and Gen.dst now routes the wave32 `exec`/`exec_lo` writes and the
wave64 `exec_lo`/`exec_hi` writes through it. The other paths into EXEC (mask_dst, put_mask,
exec_half_write's constant form, s_mov_b32's mask_src, the saveexec/wrexec forms) already give
a per-lane mask or bit and are unchanged; a real mask (0 or ~0 per lane) answers the same
under bit extraction.

The words are the GPU's, already recorded in runtime/test/shaders/cs_w32_exec_computed.asm and
cs_w64_exec_computed.asm (RTX 5070), and tests/semantic/test_exec_computed.py replays them
through the CPU interpreter. docs/design.md's constant-lane-masks row records the rule.
2026-11-24 09:48:23 +08:00
9ec34cdff4 Merge pull request #11 from wavehs/proc-544-quickstart-stage-order
docs/i18n: the nine quickstarts say the stages run together, not in a chain
2026-11-23 20:40:36 -05:00
ee2b087b66 shaders: add library_shaders build stage and guard NONE compute states
Add the build-side pipeline-library translation stage to make_game.py on top of the .state emission already merged in tools/shader_library.py, and fix a TypeError when a compute pipeline record has a NONE (0xFFFFFFFF) state index.

- tools/shader_library.py: filter NONE program/state indices when building cs_state so records without a state blob do not crash with TypeError.
- make_game.py: add LIBRARY_ARCHIVE, LIBRARY_TOOLS, library_settings(), and library_shaders() to the shaders() stage (unpacking cs programs with --disasm and --carve, translating via rdna2spirv.py, validating fspx_key_clash against non-dict/unreadable indexes, cleaning stale unpacked artifacts, and writing library_build.json).
- docs/fspx.md, docs/shader_library.md: document library_shaders(), .state emission, and runtime loading of library/index.json.
- tests/test_shader_library.py, tests/test_library_shaders_stage.py: add NONE-state cleanup and shared-code/distinct-state regression tests plus full stage reuse, invalidation, stale-artifact cleanup, clash, malformed-index, and real-tool tests.
2026-11-23 20:38:06 -05:00
7bbd5f5694 docs/i18n: the nine quickstarts say the stages run together, not in a chain
Since #1797 check runs first and then shaders, assets and runtime run
together when selected (they do not depend on each other); pipelines
starts once the translated shaders are ready. The nine translated
quickstarts still described the old check -> shaders -> assets ->
runtime -> pipelines chain. fr is left to RT-946.

(cherry picked from commit 9b03635428)
2026-11-24 03:31:32 +02:00
20c7188efd saves: reject JSON nested deeper than 512 levels explicitly
Python 3.14's json decoder is iterative, so a 100,000-level JSAV body no
longer raises RecursionError: parse_jsav accepted it, info printed
JSAV (...), verify said OK and extract died with a 1,027-line traceback
and exit 1 (json.dump recurses). The tests already expected a validation
error and noted that the C decoder's limit differs by platform; the tool
now checks the nesting depth itself (JSON_NESTING_LIMIT = 512, brackets
inside strings ignored) in parse_jsav, in verify's per-block check and in
the packed index, so a malformed save is one error line and exit 2 on
every Python.

(cherry picked from commit 79da3a9161fb0a238ddf4fd5179559bcd69c44a0)
2026-11-24 03:30:06 +02:00
7c7b5c73e7 Merge main into integrate-mirrors 2026-11-23 20:14:27 -05:00
6dece92317 Merge TreXito's unmerged PRs: translator fixes, fuzzers, CPU emulation, xapu/chad shims
Merged from the TreXito/mangrove copy of the original repository, which carried
contributor pull requests that were never merged here.

Kept: rdna2spirv fixes (ds_append/ds_consume, v_ldexp_f16 under MODE.FP_ROUND,
thread-group SGPR, fma exact), the differential fuzzers (dot, vint, wint, vrel, cvt,
f16misc, salu, mode) with their tests, the exe/import fail-fast and int3 cause tools,
Zen 2 instruction emulation (cpu_emulation.h) and the xapu.dll/chad.dll shims.

Not taken, because they conflict with different implementations already on main:
the D3D12 Xbox-ABI layer, xmem, acphal, loader TLS, f64_diff, DirectStorage (needs the
typed-error zlib inflate), and the copy's own MANGROVE.md and README changes.
2026-11-23 19:42:33 -05:00
f9c68577e3 d3d12: slot 133 textures answer GetGPUVirtualAddress with the title address
A retail title places a 256x256 R32_FLOAT texture through Xbox device slot 133
and then clears it through the value GetGPUVirtualAddress returns, used as a CPU
pointer. The layer answers 0 for a texture, as D3D12 does, so the title wrote
256 KB at address 0. XCL measured the same clear and returns the address the
title placed the resource at (its PR #168).

A slot-133 placed texture still gets its committed fallback image, but records
the title address and reports it from GetGPUVirtualAddress. Ordinary textures
still answer 0 and buffers are unchanged. The pixels do not alias the title's
pages yet, so a write through the address is not uploaded; that is the
page-mapper work and is called out in docs/d3d12_vulkan.md.

Tests: d3d12_existing_heap_test checks that the RENDER_TARGET layout and the
COMMON retry both answer the title address; it exits 0, and gta6rt links.

AI-assisted: DeepSeek V4.1 Flash 1017 (Alibaba Token Plan); coordinated by Qwen4 Max Preview.
2026-11-24 01:29:22 +01:00
a8b7ddbd50 Make main's tests green, part 2: docs drift, bvh_slot_check, find_hash_lookup (#10002)
Seven more test files that fail on main at d083a2c, after #9896:

- test_docs_repeated_lines: tests/semantic/README.md's command block is a fenced block, which the check skips;
  its indented form put two lines with the same 40-character opening three lines apart
- test_docs_repo_paths: docs/retail_boot_intel_host.md names #8554's frame-loop notes instead of a path that
  is not in the tree
- test_docs_env_vars: runtime/README.md documents LEONIDA_RNG_SEED (runtime/shims/bcrypt_rng.cpp)
- test_docs_design_rows: docs/README.md gets one row each for strand_grooms.md and ped_catalogues.md (two
  rows each were merged in), and design.md escapes the pipe in `prim_cnt << 12 \| vtx_cnt`
- test_docs_cli_flags: docs/testing.md passes llvm-mc through LLVM_MC, so `brew --prefix` is no longer read as
  a bench_wave64.py flag; pt-PT's quickstart points to the web checker that replaced tools/pc_checker.py
  (5125a01), as README.md does; the spirv-opt passes docs/embedded_shaders.md quotes join FOREIGN
- test_bvh_slot_check: bvh_match.model_geometries() yields six fields since the render bucket was added;
  unpack the two it needs
- test_joaat_agreement (find_hash_lookup's half): hash over the Latin-1 bytes like hashdict.joaat, as #6254 and
  #7820 proposed

Still red, for a separate change: test_joaat_agreement's leonida_mods half (it hashes UTF-8 bytes like
runtime/src/mods.h, so both sides change together), test_f64_conversion and test_f64_output_modifiers (they
expect the output scaling #6314 gated by MODE) and test_bvh_shaders_stage.
2026-11-24 00:28:18 +01:00
7067ff2f2b Merge pull request #5038 from ray3242/fix/i18n-es-quickstart-sync
docs(i18n/es): sync quickstart with current README (issue #4737)
2026-11-24 00:13:34 +01:00
c1f6b5bb52 Merge pull request #3637 from ray3242/devin/1795381635-design-leftovers-2
docs/design: remove the duplicated image-query contract row
2026-11-24 00:12:17 +01:00
e56d97950f Merge pull request #2498 from iasmitionsalvatore/pr/footprint-base-offset
d3d12: GetCopyableFootprints aligns from BaseOffset
2026-11-23 23:47:26 +01:00
bacf6f4e2a Merge remote-tracking branch 'origin/pr/8953' 2026-11-23 17:41:05 -05:00
2c9d676b24 Merge remote-tracking branch 'origin/pr/8957' 2026-11-23 17:41:04 -05:00
a5c9e54bf5 Merge remote-tracking branch 'origin/pr/8982' 2026-11-23 17:40:57 -05:00
e10ec61417 Merge remote-tracking branch 'origin/pr/8987' 2026-11-23 17:40:56 -05:00
d0c0fe437a Merge remote-tracking branch 'origin/pr/8988' 2026-11-23 17:40:56 -05:00
08c750ce7f Merge remote-tracking branch 'origin/pr/8989' 2026-11-23 17:40:56 -05:00
185ed7e319 Merge remote-tracking branch 'origin/pr/8993' 2026-11-23 17:40:55 -05:00
28a7ffd260 Merge remote-tracking branch 'origin/pr/9001' 2026-11-23 17:40:53 -05:00
fecb7797c8 Merge remote-tracking branch 'origin/pr/9003' 2026-11-23 17:40:52 -05:00
a63a7860e5 Merge remote-tracking branch 'origin/pr/9490' 2026-11-23 17:32:52 -05:00
89ca1aa169 Merge remote-tracking branch 'origin/pr/9488' 2026-11-23 17:32:51 -05:00
21714399e8 Merge remote-tracking branch 'origin/pr/9761'
# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
2026-11-23 17:30:03 -05:00
f7b3afcda9 Merge remote-tracking branch 'origin/pr/9754'
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 17:29:12 -05:00
4fa19c6f78 Merge remote-tracking branch 'origin/pr/9758'
# Conflicts:
#	tests/test_pc_checker.py
#	tools/pc_checker.py
2026-11-23 17:27:57 -05:00
b97d7b85cb Merge remote-tracking branch 'origin/pr/9755'
# Conflicts:
#	docs/README.md
2026-11-23 17:27:49 -05:00
2c8ed2d483 Merge remote-tracking branch 'origin/pr/9741'
# Conflicts:
#	docs/gpu_test_results.md
2026-11-23 17:26:45 -05:00
14cebd5afe Merge remote-tracking branch 'origin/pr/9730'
# Conflicts:
#	docs/gpu_test_results.md
2026-11-23 17:25:59 -05:00
2f6aa6fb5b Merge remote-tracking branch 'origin/pr/9765' 2026-11-23 17:24:53 -05:00
04f6d5245e Merge remote-tracking branch 'origin/pr/9750' 2026-11-23 17:24:49 -05:00
d0707969f0 Merge remote-tracking branch 'origin/pr/9742' 2026-11-23 17:24:47 -05:00
2c5dfe4e42 Merge own/main: cl.exe fallback list, per-program translator errors, merge leftovers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:19:02 +00:00
cbc9ef4dbd Fix merge leftovers the Python suite found on own/main
Four tests failed on own/main but not on upstream main, or failed with more items:

- docs/runtime_imports.md had four copies of the owns_dll sentence, one per merged
  shim PR; one sentence now names every DLL (test_docs_repeated_lines).
- docs/README.md had two directstorage.md and two gameinput.md rows; keep the
  directstorage row that has zlib and upstream's gameinput row (test_docs_design_rows).
- test_ctest_registration only saw add_test(... COMMAND foo_test); the pipeline cache
  seed test is driven by a CMake script as $<TARGET_FILE:pipeline_cache_seed_test>,
  which ctest runs too.
- tools/int3_cause.py sets errors='replace' on stdout like the other tools
  (test_tool_stdout_encoding).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:16:27 +00:00
29bd7a11a6 gameinput: the device info has its GameInputLabel members
gameinput_abi.h left out the labels of the public v0 layout. In
GameInputControllerAxisInfo and GameInputControllerButtonInfo a label
sits at offset 4, in what is otherwise padding, so the sizes matched
while isContinuous, restValue, legacyDInputIndex and rawReportIndex were
four bytes early. GameInputGamepadInfo and GameInputUiNavigationInfo are
tables of 14 and 21 labels; they were declared empty, and the pointers
in GameInputDeviceInfo led to one-byte members, so a title reading a
label read whatever followed.

The header declares the enum, the two tables and the two label members
and pins each offset that moved. fill_info gives every control the Xbox
label of its position on every pad, since every pad is presented as an
Xbox One pad.

gameinput_test reads the tables by the public header's byte offsets, so
the shim's own header cannot agree with itself.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 23:15:46 +01:00
d578b4806e Tests: GPU coverage for ds_wrxchg*_rtn_b64, ds_or_rtn_b64, ds_min_f32 and ds_max_rtn_f32
docs/design.md marks the 64-bit LDS exchanges not GPU-verified, and
cs_lds_atomics_ext.asm (#9494) leaves ds_or_b64 and the f32 min/max
forms out. cs_lds_xchg64_ext.asm runs one lane through
ds_wrxchg_rtn_b64 (both dwords left and the returned pair),
ds_wrxchg2_rtn_b64 at offsets 0/2 (four old and four new dwords),
ds_wrxchg2st64_rtn_b64 at offsets 1/2 (512-byte steps), ds_or_rtn_b64,
ds_min_f32 with a quiet NaN in memory and ds_max_rtn_f32 ordering -0.0
below +0.0. The eight expected words are derived in its header from
the rows. Registered in check.py and run_gpu_tests.py next to
cs_lds_b64_cmpst; the wrxchg row notes the GPU check (the min/max and
bitwise b64 rows get theirs in #9494, to keep the two PRs apart).
2026-11-23 14:09:15 -08:00
98a688ece4 Merge PR #9607 2026-11-23 17:09:05 -05:00
3f2f9e7f66 Update gpu_test_results.md 2026-11-24 00:09:03 +02:00
db333b7fa7 Merge PR #9606 2026-11-23 17:09:03 -05:00
5af8d96693 Merge PR #9603 2026-11-23 17:08:58 -05:00
5125a01f03 Remove pc_checker.py and point to web checker
Removes tools/pc_checker.py and its test, and updates README and
docs/testing.md to link to https://assttro.github.io/can-i-run-leonida/
as a lightweight browser-based alternative.

Closes #9711
2026-11-23 23:08:43 +01:00
508fde4118 Merge PR #9592 2026-11-23 17:08:41 -05:00