Commit Graph

18350 Commits

Author SHA1 Message Date
ecb9f93a0d launcher: settings, command lines, output parser and state machine
The launcher's logic, without a window:

- config: a versioned settings file in the user's configuration folder;
  missing, broken or newer files give the defaults.
- repo: the repository found by --repo or by walking up to make_game.py;
  the executable's name from the version manifests.
- commands: make_game.py's check and build (python -I -u, python3 off
  Windows) and the loader as docs/boot.md section 2 runs it, on Windows
  and through gta6rt.sh and Wine on Linux; each setting's flag or
  environment variable (--stages, --wav, --full-check, --jobs,
  --wave64-emulate, LEONIDA_VK_DEVICE, LEONIDA_VK_VALIDATION,
  LEONIDA_UNIMPLEMENTED, gta6rt --trace-d3d12 and --overlay).
- output: make_game.py's log lines to a build's stages, and @@stage,
  @@progress, @@eta, @@check, @@done and @@error lines if it prints them.
- state: the primary action (Check, Build, Play or Cancel), why it's
  blocked, and the status line; "not bootable yet" reads as an
  explanation.
- process: a command's output read on background threads; cancelling
  ends its process tree. Tested with a stand-in shell script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 11:42:27 -05:00
60ff0a2346 launcher: a design system in the logo's colours, on stock iced 0.14
A new Cargo package in launcher/ for a desktop launcher. src/ui/ is its
UI kit: the design language's tokens (colors, type, spacing, radii,
motion, glow), the theme, text roles, fonts and focus model, and the
widgets the window shows, each with its states, focus and keys: button
(with a large variant), text field and its editing rules, checkbox,
choice, switch, toggle group (draggable), loader, progress, status chip,
scroll area, sidebar list, settings groups, form, the window's own
decorations, the folded window, and the window's state with a theme
crossfade and a LEONIDA_WINDOW_FRAME switch.

Two palettes, Sunset dark and light, come from the logo's pixels. Its
light orange and dark purple are the two colours: orange the main and
purple the secondary in light, the other way round in dark; every glow
takes the secondary. Tests check every ink on every surface at 4.5:1.

The window's rounded corners use iced_wgpu's public primitive API, with
rounded quads where the renderer can't draw it. On Windows, where stock
iced can't present a transparent window, the frame asks for Windows 11's
rounded corners and draws its line at their radius.

The four fonts the text roles use are embedded with their SIL Open Font
License texts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 11:42:27 -05:00
223df1094d Merge origin/main into carry/pr-279
runtime/test/vk_test_device.h: the PR's filterMinmaxImageComponentMapping
query and main's shaderOutputViewportIndex feature were added at the same
place; both are kept.

Co-authored-by: Zilumz1 <221744236+Zilumz1@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 17:42:04 +01:00
f051ae5183 d3d12/tests: fix Windows MSVC build, CopyMemory collision, copy parity guard, and --no-ftz32 probe 2026-11-29 11:41:49 -05:00
ffd3681b29 d3d12: a pipeline a frame waits for goes before those asked for earlier (D3D12-PIPELINE-WAIT-QUEUE)
A draw whose host pipeline is not made queues it at the back of the
requested list, and its frame then waits for it up to the frame's budget.
On the first visit to the world about 1,700 pipelines were queued at once,
562 of them took over a second each, and with the launcher's 10 s budget
every frame waited the whole budget for a pipeline a thousand others stood
before, then dropped its draws anyway: 0.35 fps for three and a half
minutes (RTX 3080, 8 workers).

A new queue state, AWAITED, sits between REQUESTED and MAKING. When a frame
starts waiting for a pipeline that is still in the queue, the entry moves
to the front of its list (passes over the screen in theirs), after those
awaited before it, so the next free worker makes it. It moves at most once,
is never claimed twice, and WAITING does not count it again; makes already
running are not interrupted. LEONIDA_PIPELINE_AWAIT_FIRST=0 keeps the order
asked.

Frames on a cold cache still wait up to the frame's budget: the waits now
succeed, so a frame may spend its budget on several pipelines it then draws
instead of one it drops. The budget setting bounds that, as before.
2026-11-29 17:38:07 +01:00
5d72958bfa d3d12: frame-time panel lines fit long stalls, the first line counts from the first present (review)
- Panel: frame times of 10 s or more (the launcher's pipeline budget) made
  the percentile line longer than 40 columns, and the panel cut it without
  a sign ("MAX 10000" showed as "MAX 100"). Times from 10 s up are shown in
  whole seconds ("10S"); the test covers 10 s, 100 s and 10 min.
- The first line's pipelines made a second and residency waits counted
  everything since the process started: the meter now starts from the
  totals at the first present.
- "queued" was queued or being made: the log says so, the panel says
  PIPES PENDING.
- The nearest-rank test covers 95% of 100 frames, where a float ceil would
  take the 96th.
2026-11-29 17:37:48 +01:00
877c0d14a8 d3d12: BAR-windows note at info level, names GPU upload heaps, and the decision covers the off case (review)
- The note is info, not a warning: the launcher sets the cap by default on
  PCs under 48 GB, so it shows on every one without resizable BAR.
- It names the real condition (GPU upload heaps: resizable BAR, and a
  Windows and driver that offer them), as the doc comments do.
- mapped_windows asks for support only when a cap is set, so its "off" case
  is the one the code takes, and the test checks that support is not asked.
- The launcher's history comment and the README say "unless the card has
  under 6 GB" (an unknown size counts as large).
2026-11-29 17:36:49 +01:00
0bc6e21a10 The decal heap's relocations run, paired with the programs that move its blocks; capture by size
- The paired form takes a group of several console waves where every s_barrier is one each wave
  passes once whichever way it goes (emit::barriers_on_every_way: the block dominates every end
  and is in no loop); its LDS accesses are then fenced instead of waiting for the group, and it
  lowers ds_read2st64/ds_write2st64, the atomics with the old value back and ds_cmpst_rtn_b32.
  CS_DefragHeap_ComputeRelocations (02384a60fda6f2d0), dropped every frame before, now runs.
- A program named in LEONIDA_PAIRED_FOR takes the paired form before its own translation, so
  the launcher's names reach the five programs that move the heap's blocks (they copy
  overlapping 1 KB blocks, and in 32-lane halves one half stored over what the other had not
  read yet: white blotches there). The launcher names all six.
- LEONIDA_DUMP_SIZE=<w>x<h>[,..]: only targets of those sizes are saved with
  LEONIDA_DUMP_TARGETS (a frame renders some 380 targets, 61 at the screen's size; saving all
  took 11 s a frame).
- docs/findings.md: what a timeline of three frames shows (the card idle 22 ms a frame behind
  DirectStorage, texture refreshes and the submitting thread; 76 ms a frame of waits for the
  guards' lock).

After voidopcode/vilocity add4873 (GPL-3.0-or-later).

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64: the paired-form tests (18,
those that run on the card included) and a new one for groups of several waves; a warm-up
start and a recorded tour (runs d46, d47): the relocations and the mover in use translated
and bound, only the two particle programs refused, no removed device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 11:30:58 -05:00
ac93aac0d4 d3d12: gate write_tsharp_index_words on in_known_heap during stream publish 2026-11-29 11:27:30 -05:00
59ce2c87b0 Merge origin/main into carry/pr-65
tools/rdna2spirv.py: main's d16 "destination is also read" check (now
DST_ALSO_READ, plus buffer_load_format_d16_hi_x) gains the PR's flat_load_
prefix. docs/design.md: main's 8/16-bit global row is kept and the PR's
"Flat memory" row follows it.

Co-authored-by: tiagonogueiraa-bit <360313680+tiagonogueiraa-bit@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 17:23:56 +01:00
51445af783 Merge origin/main into carry/pr-282
Conflict in the x_memory_order docstring (tools/rdna2spirv.py): main already
ignores ds_nop (80417b9c4), so the PR's part still new is ordering
image_sample, image_gather4 and image_bvh; its docstring is kept. The PR's
parity test probe gains x_one_lane, which main's Gen.x_memory_order reads.

Co-authored-by: totonii <totonicontato@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 17:14:37 +01:00
6d5a3ba260 windows-boot: test_crash_monitor reads its text files as UTF-8 (text-encoding lint red on main since 1b9e4969) 2026-11-29 08:03:13 -08:00
9e3218f0e9 Merge remote-tracking branch 'origin/main' into next 2026-11-29 11:01:42 -05:00
804280d803 Fork ports of 2026-11-29: faces, texture copies into title memory, the paired forms, switches by turns
Picture:
- Cutscene faces with only their eyes and teeth since the LDS bounds: the 25 face programs
  (the face network's operations, the normals rebuilt from blend shapes) keep their LDS
  accesses unbounded, by name and in the cache's key (LEONIDA_LDS_BOUNDS_EXEMPT; trustno1-coder
  9eb44fa6, Victorywillbeours222). Six of them run in the waterside tour.
- Copies and resolves into textures the title fills go back into title memory once their list
  has run, only the subresources written and of them the 4 KiB pages that change
  (LEONIDA_COPY_BACK, on; voidopcode/vilocity ee93826): a view the title places over that
  memory was made from bytes the copy never reached (faces in blocks of colour, clothes in
  another texture's). 9,216 copies (52 MB) in a run of 8 minutes; by turns the frame's median
  -0.33 +-0.50 and +0.34 +-0.25 ms.
- A list's prelude leaves out its upload of a texture another list wrote on the host GPU and
  submitted first (LEONIDA_UPLOAD_GUARD; trustno1-coder e530c003, aventureroestelar-source),
  noted only while the texture is still the title's.
- A texture asked for as reserved (levels on demand) is no longer cut from the pool, where it
  was never reserved and was made whole again (aki-gta6/aki-runtime ad214cd, KeethSmith).
- The launcher names all 33 programs the chain gave an approximate form in LEONIDA_PAIRED_FOR
  (timing runs d39: 1.98 ms of card a frame against 2.31 for the eleven before; tours d37, d38
  with nothing broken), and keeps device-removed data to the faulting address (d35: the card
  83 % busy against 89 % with breadcrumbs, the frames alike).

Shader translator (one re-translation): global stores count as UAV writes for early depth
(trustno1 788fe236); a sum of high halves is not taken for a wave reduction (Bebrik229); SDWA
sign-extended selects; mesh loops leave at their own exit at the limit instead of a `ret`
(LEONIDA_MESH_LOOP_EXITS, trustno1 6bbb6bca); readers indexed once per lowering (trustno1
7cc0d153, 101Leafy); raw FSSM records (XDAT 0x0c) read (fuzeofficial, via MiniVI 96e788c7).

Submitting thread, by turns of 4 s standing (runs d41, d43):
- Two lock passes, off by default (`=1` on): slot writes past the heap's lock of placed views
  (LEONIDA_SPANS_QUICK; Belobug a284ca7 via readmet3xt 96dfd9bb8, trustno1 #1937) and the
  texture queue's lock spared by marks (LEONIDA_QUEUE_MARKS; readmet3xt-lab b377071). Here no
  one waited for those locks: the submitting thread +0.12 to +0.30 ms a frame with them.
  `crate::asked!` is `toggled!` off by default.
- 8 parts joined against 2 (LEONIDA_JOIN_PARTS_AB): with 8 the frame -3.09 +-0.51 and -3.03
  +-0.26 ms, so the launcher's 8 stays. The write-watch asking joined across 8 MiB against
  256 KiB (LEONIDA_ASK_GAP_KB, _AB): with 8 MiB the card -1.08 +-0.50 and -1.14 +-0.22 ms busy.

AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64: the named unit tests of each
port (shader 12, gpu 11, texback and resource 36), a warm-up start (the same three programs
refused as before, no device removed), the turns above and recorded tours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 11:01:18 -05:00
1d3da5ebc7 Merge pull request #959 from Kadamitas/fix/gfx10-sampler-z-filter
gfx10: preserve the separate volume filter in sampler words
2026-11-29 16:46:15 +01:00
0cedc3a625 Merge pull request #1918 from kawaii-shakal/fault-address-owner
d3d12: the device-fault report names what the process and the driver had at each fault address (RT-FAULT-ADDRESS-OWNER)
2026-11-29 16:45:59 +01:00
cec4182c2d Merge pull request #1424 from Anonymous78e/ctest/xdxr-check-timeout
runtime: xdxr_build_check gets its own ctest TIMEOUT (CTEST-XDXR-CHECK-TIMEOUT)
2026-11-29 16:45:32 +01:00
bd1521ca03 Merge pull request #1421 from thiefyzheng/fix/test-meshalloc-syspath
tests: test_mesh_alloc_single_writer inserts 'tools' by __file__, not cwd (TEST-MESHALLOC-SYSPATH)
2026-11-29 16:45:19 +01:00
ae2ef0c5cf Merge pull request #1325 from delysidemanYT1/gpu-check-subprocess-output
Shader checks: preserve subprocess diagnostics and validate probe output
2026-11-29 16:45:04 +01:00
006e9f435f Merge pull request #1146 from Christopher-Sundeby/fix/file-system-test-c4456
file_system_test: build without the C4456 shadow warning (TEST-FS-C4456)
2026-11-29 16:44:51 +01:00
4ebfec34d7 Merge pull request #846 from TheGeogeo/fix/preserve-pipeline-crash-report
make_game: preserve crash reports when a retry fails setup (BUILD-PIPELINE-RETRY-CRASH-REPORT)
2026-11-29 16:44:37 +01:00
bfb54b8759 Merge pull request #778 from kawaii-shakal/d3d-sample-positions
d3d12: replay programmable sample positions (D3D-SAMPLE-POSITIONS)
2026-11-29 16:44:17 +01:00
fd5ad13bd9 Merge pull request #2154 from whoalin1/shader-stage-cache-crossroot
rdna2spirv: cache shader stages per carve root
2026-11-29 16:44:05 +01:00
f72a68bc0b Merge pull request #2089 from KushGene/fix/vk-sampler-lod-order-and-deriv-adjust
gfx10_descriptors: clamp sampler maxLod >= minLod and guard DERIV_ADJUST_EN integer border (VK-SAMPLER-LOD-ORDER-AND-DERIV-ADJUST)
2026-11-29 16:43:52 +01:00
1589d2a5ac Merge PR #2566 head (91b7d7372, dynamic R32_UINT already applied in ce792f55f) 2026-11-29 10:43:49 -05:00
40b88ff7fc Merge pull request #2051 from alexandersato0830/codex/spirv-word-endianness
Normalize SPIR-V file byte order (SPIRV-WORDS-ENDIAN)
2026-11-29 16:43:39 +01:00
950259cd40 Merge pull request #1931 from kawaii-shakal/io-trace
dstorage, fs: LEONIDA_IO_TRACE logs every read the title asks for, flushed as it goes (RT-IO-TRACE)
2026-11-29 16:43:26 +01:00
865f6c24e3 d3d12: FSR 3 frame generation for cards without DLSS frame generation (D3D12-FSR3-FRAMEGEN)
DLSS frame generation runs on RTX 40 and 50 cards only. LEONIDA_FSR_FRAMEGEN=1 (the
launchers' -FsrFrameGen, or the F1 menu) presents through AMD FidelityFX's frame
interpolation swap chain instead: one generated frame between two of the title's, on RTX 20
and 30 cards and on any other D3D12 card.

- fsr.rs (new): loads amd_fidelityfx_loader_dx12.dll and amd_fidelityfx_framegeneration_dx12.dll
  from LEONIDA_FIDELITYFX_DIR (d3d12\amd-sdk\FidelityFX\bin by default) once WinVerifyTrust
  finds both signed, makes the swap chain, and before each present dispatches the prepare
  step with the depth, motion vectors, render size, jitter and camera range fg.rs collects for
  DLSS. The title's colour without the interface goes in when the frame is one composed plane.
  Not made while Streamline's frame generation is active.
- fg.rs: the inputs are collected while either frame generation is on (collecting()), and
  inputs_for_present() hands them to fsr.rs.
- host.rs: the swap chain comes from fsr.rs when it is on, and it is told before ResizeBuffers.
- The F1 menu has FSR 3 FRAME GEN 2X; it can be turned off and on while the game runs.
- play-nvidia.ps1 / play-d3d12.ps1: -FsrFrameGen and -FidelityFxDir; FSR frame generation is
  off with ray tracing, and LEONIDA_TEXTURE_ROOM_PERCENT defaults to 80 with it, since it holds
  1.5 to 2 GB of video memory.

Ported and adapted from trustno1-coder/VIctory-NVIDIA crates/victory-gpu/src/streamline/fsr.rs
(29d8dbf, GPL-3.0); credited in d3d12/README.md and the module's notes. AMD's DLLs are not in the
repository: the user puts them in the folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 12:43:22 -03:00
15701e412d Merge pull request #1894 from ecox982745/ecox/title-staged-per-format
d3d12: stage title textures when their format or usage rules out host copies
2026-11-29 16:43:14 +01:00
d00d46c1e4 Merge pull request #1839 from delysidemanYT1/gpu-spirv-as-diagnostics
GPU-SPIRV-AS-DIAGNOSTICS: Preserve spirv-as diagnostics containing undecodable bytes
2026-11-29 16:43:01 +01:00
3580a9d308 Merge pull request #1831 from potatoe0100/carry/old-9966
gameinput: preserve controller transitions between polls (OLD-9966, carries #233)
2026-11-29 16:42:49 +01:00
38719cc36f Merge pull request #1775 from potatoe0100/carry/old-9773
OLD-9773: d3d12: refuse a pipeline whose shader needs VK_KHR_maintenance8 on a device without it
2026-11-29 16:42:29 +01:00
6024351682 Merge pull request #1739 from IlyassRS3/fix/descriptor-table-guards
runtime: guard DescriptorTable 9-way collision, read_slots width, and change-tracking OOM
2026-11-29 16:42:16 +01:00
daf8122003 Merge pull request #1681 from ImLele69/rt-alloc-no-rebar
d3d12_vulkan: without Resizable BAR, textures and staging buffers leave the BAR window to the arena; tile heaps prefer VRAM (RT-ALLOC-NO-REBAR-RETRIES)
2026-11-29 16:42:02 +01:00
fc99d468a8 Merge pull request #1417 from whoalin1/vk-image-fuzz-drawparams
vk_image_fuzz: enable shaderDrawParameters for the translated vertex shader
2026-11-29 16:41:49 +01:00
3ef235a681 d3d12/vulkan: rebind released sparse pages to shared zero page on AMD proprietary 2026-11-29 10:40:34 -05:00
6ebdee1978 tests: honor GPU float32 flush-to-zero support in shader fixtures 2026-11-29 10:40:34 -05:00
7599556c37 awc_manifest: publish mode on Windows (AWC-MANIFEST-STAGE-CLEANUP)
agent: yes
AI-assisted: yes
2026-11-29 18:24:24 +03:00
eeb967c89e shader_disasm: restore write mode before unlink on replace failure and publish mode (SHADER-DISASM-STAGE-CLEANUP)
Apply published_mode(out_file) to temporary listing before atomic replacement,
and restore write permission (0o600) before unlinking in finally block
when replace fails, preventing Windows PermissionError [WinError 5] and
stranded temporary files.

agent: yes
AI-assisted: yes
2026-11-29 18:24:20 +03:00
ca8a627c5c bary_fallback_gs: restore write mode before unlink on replace failure and publish mode (BARY-FALLBACK-GS-STAGE-CLEANUP)
Apply published_mode(asm/spv) to temporary files before atomic replacement,
and restore write permission (0o600) before directory cleanup in exception block
when replace fails, preventing Windows PermissionError [WinError 5] and
stranded temporary files.

agent: yes
AI-assisted: yes
2026-11-29 18:24:17 +03:00
912d15cc7a mesh_compute_vs: restore write mode before unlink on replace failure and publish mode (MESH-COMPUTE-VS-STAGE-CLEANUP)
Apply published_mode(spv) to temporary staged SPV before atomic replacement,
and restore write permission (0o600) before directory cleanup in exception block
when replace fails, preventing Windows PermissionError [WinError 5] and
stranded temporary files.

agent: yes
AI-assisted: yes
2026-11-29 18:24:15 +03:00
cc5d5e3123 manifest: restore write mode before unlink on replace failure and publish mode (MANIFEST-STAGE-CLEANUP)
Apply published_mode(out) to staged manifest file before atomic replacement,
and restore write permission (0o600) before TemporaryDirectory cleanup in
exception block when replace fails, preventing Windows PermissionError [WinError 5]
and stranded temporary files.

agent: yes
AI-assisted: yes
2026-11-29 18:24:12 +03:00
3e0f3074c4 manifest_verifier: restore write mode before unlink on replace failure and publish mode (MANIFEST-VERIFIER-STAGE-CLEANUP)
Apply published_mode(path) to temporary cache file before atomic replacement,
and restore write permission (0o600) before unlink in exception block when
replace fails, preventing Windows PermissionError [WinError 5] and stranded
temporary cache files.

agent: yes
AI-assisted: yes
2026-11-29 18:24:10 +03:00
c22a0a7322 Merge pull request #719 from kirigayakazima/fix/glb-writer-ro-cleanup
glb_writer: cover failed replacement of a read-only GLB on Windows
2026-11-29 15:53:15 +01:00
5d1d6c85f5 d3d12: frame-time percentiles and what stalls frames, in the log and on the panel (D3D12-FRAME-TIME-STATS)
The frame-rate line gives a mean over the last second or more, and the F3
panel only the longest frame, so a run with smooth frames and a few
multi-second stalls looks like a slow one, and the stalls do not show.

host/frametime.rs keeps every presented frame's time. With the frame-rate
line, every five seconds, it logs one line: the median, 95th and 99th
percentiles (nearest rank), the longest frame, how many took over 100 ms
and over a second, and beside them host pipelines queued and made a second,
waits for new memory to be resident per frame, and the commit the system has
left. The panel shows the last line's numbers and the pipeline wait per
frame. Pure parts are unit-tested.
2026-11-29 15:45:17 +01:00
bd643e46e7 Merge pull request #1167 from robot00f/docs/b5
docs(audio_hal_exe_calls): fill the argument gaps the page left open (AUDIO-IMPORT-CALL-SHAPES)
2026-11-29 15:41:47 +01:00
ca89cb0189 Merge pull request #1045 from robot00f/docs/agent2
docs(d3d12_command_objects): 0x48/0x50 are heap handle getters on heap objects (D3D12-HEAP-HANDLE-SLOTS)
2026-11-29 15:41:39 +01:00
a793e3fdf4 Merge pull request #1010 from robot00f/docs/d3d12-createdevice-params
docs/boot: the CreateDevice params are 0x50 bytes, not 24 words (D3D12-CREATEDEVICE-PARAMS)
2026-11-29 15:41:29 +01:00
e7281f33ff Merge pull request #1143 from robot00f/docs/b2
docs(d3d12_vulkan): what the title does with GetDescriptorHandleIncrementSize (D3D12-DESCRIPTOR-INCREMENTS)
2026-11-29 15:38:57 +01:00
50d09b373c Merge pull request #1018 from robot00f/docs/agent5
docs(d3d12_vulkan): the title already supports the linear tile path (XG-SWIZZLE-LINEAR-PATH)
2026-11-29 15:38:45 +01:00