Skip to content

[OFFICIAL] Swarm: ports from the VIctory line (GPL-3.0) into XCL #3011

Backlog

Description

@throny

Goal

Coordinate ports from the VIctory line into XCL, now that XCL is GPL-3.0-or-later (#3002), so that the things that already make the retail title playable there reach XCL quickly and nobody ports the same piece twice.

The public tracker (https://github.com/vuyp/gta6-pc-race) lists about 37 projects ahead of XCL on this title; nearly all descend from one Rust code line: VIctory, victory-fork and, built on them, Vice-Tay, which reports the world under player control at a median of about 21 frames a second on an RTX 4090. All three are GPL-3.0.

Do not post title binaries, packages, keys, dumps, proprietary names or DRM-related material. Hashes and aggregate measurements only.

Rules for a port (from the maintainer's answer on #3002)

  • Keep the original copyright and licence notice; add a provenance note in the file header (project, URL, licence, date of changes) and an entry in THIRD_PARTY.md. GPL-3.0-only files stay GPL-3.0-only inside XCL.
  • A port is a normal PR: one logical change, under ~400 lines where it can be split, tests, the whole suite, smoke blocks, Tested / Not tested, AI use named. Say which upstream commit the code was taken from.
  • Port the mechanism, not the tree: adapt to XCL's modules and switches (new behaviour behind a switch first when it changes what a title sees).
  • Credit the upstream authors in the PR description.

How to claim

Comment with claim: <piece>, the upstream files and commit you port from, the XCL files you expect to touch, and when you expect a draft PR. One claim per person at a time. A claim with no draft PR after 48 hours is free again. Link the PR here when it is up; testers post results on the PR.

What stops XCL today (measured, NVIDIA 16 GB; AMD owners please add yours)

  1. GPU-bound frames: about 2 presents per second in the world with the GPU at 100 %; a GPU profile by another tester puts nearly half of the title's GPU time into the pieces of split compute programs.
  2. Memory: 45-58 GB of process commit and video memory at the budget, because the title's GPU heaps and textures are backed 1:1.
  3. Pipelines: large compute pipelines take 10-30 s each to create on some drivers even from a stored blob; draws and dispatches are skipped or stall meanwhile.
  4. Two-pass geometry buffers hit their cap and drop draws.
  5. Stability: device removal at the driver's shader-heap limit (NVIDIA: the device is removed when the pipelines in use need more than 512 MB of shader code (0x887a0005) #2403), and a black world on Intel CPUs since PE loader: a title's CLZERO loops run as native code on a CPU without CLZERO #2892 (being looked at there).

Candidates

A first comparison of how the VIctory line solves these (which files, how large, how self-contained, in which order) is being written and will be posted here as the first comment within the next hours, so that claims can refer to named pieces. If you already know a piece well (texture streaming, heap placement, mesh shading, pipeline scheduling, frame pacing), say so: a claim by someone who has read that code is worth more than the list.

Not in scope here

I will also coordinate with people on the XCL Discord; decisions and claims belong here so that everyone can see them. AI use: Claude Code (Claude Fable 5.2) drafted this at my request.

Activity

  1. throny commented on Nov 27, 2026

    @throny
    CollaboratorAuthor

    Candidates: what the VIctory line does differently, and what to port first. From a read-only comparison of Vice-Tay 1f69d67 (with VIctory 63bcca4 and victory-fork 9a9091d where it inherits) against nvidia-dev 3f39671d. Nothing was built or run for this list, so every "why it matters" is a reading of their code and docs, not a measurement on XCL. Corrections from people who know either tree are welcome.

    Why they are at ~20 fps and XCL at ~2 (as read):

    • They never split compute programs: one DXIL program per console program. XCL splits programs over 12,500 instructions into chains of pieces, and a GPU profile here put ~46 % of GPU time into those pieces.
    • On 32-lane GPUs they run most wave64 programs without the exchange between the two halves (retry without early-outs first, then "each half is its own wave" where that is exact); the barrier-based exact form is kept for a handful of programs. XCL uses the exact exchange everywhere it applies.
    • Console mesh shading is one native mesh-shader pass. XCL uses two passes with capped record buffers.
    • About 1,000 ray-tracing resolve programs are left out when no acceleration structures are built.
    • Title heaps stay in system memory and textures get host copies only when used, with admission against the video-memory budget (their docs: 9-11 GB peak on 16 GB cards).
    # Piece Upstream source Blocker it targets Size Notes
    C1 Pipeline library (ID3D12PipelineLibrary1 in a mapped file) for XCL's own pipelines, first for the whole forms of split compute programs Vice-Tay victory-gpu/src/pipeline/library.rs (~600 lines without tests) pipelines; unlocks running whole forms instead of chains S minimal, M full Their comment puts a library load at ~20 ms. Whether it beats CachedPSO on drivers where blob loads take 10-30 s is the first thing to measure. Leave out pipelines with static samplers at first (they note wrong results on NVIDIA); keep the file handle open.
    C2 Cheaper wave64 on 32-lane hardware (retry order, exact "local waves" tier only) victory-shader/src/emit/lower.rs, emit/mod.rs (~500 lines on their IR) GPU-bound frames, DXIL size M A re-implementation on XCL's IR, not a copy. Translator change: full shader recompile for testers.
    C3 Leave out ray-tracing resolve / activation pipelines when no structures are built, behind a switch victory-gpu/src/pipeline/make.rs (~40 lines) pipelines, GPU time S Changes the picture; XCL emulates BVH intersection, so check first whether XCL's rays produce hits.
    C4 One-pass native mesh shaders for console mesh shading emit/lower.rs, pipeline/host.rs, draw.rs GPU time, two-pass buffer cap L Depends on C2. High risk (driver hangs).
    C5 Video-memory admission for title textures (budget, room for targets, back-off) victory-gpu/src/residency.rs + rules in texture.rs memory L (S for the back-off alone) Depends on per-texture host copies, which XCL does not have.
    C6 CLZERO loops patched at the first fault, at that site only, atomically instead of scanning executable sections up front victory-loader/src/console_insn.rs (~160 lines; the file's base was ported from XCL) black world on Intel since #2892 (hypothesis) S @Prime1997 this is next to your #2892; it would make sense for you to take it or say no.
    C7 Output size / render scale victory-loader/src/resolution.rs GPU time - Do not port as is: it patches title code at fixed offsets, which is game data under XCL's rules. Re-derive through the title's settings.

    Not worth porting (XCL has it as well or better): async pipelines with stand-ins and wait budgets, the Series S profile, GPU access to title memory in place (they copy shader writes back and measured 32-50 ms a frame for it on one card), the console CPU-instruction decoder (theirs is XCL's), the direct-DXIL clean-up passes.

    Provenance traps when porting: MIT notices that must travel with gfx10/opcodes.rs (generated from Mesa, Valve) and victory-formats/src/texture.rs (AMD addrlib); a Wine patch under linux/ (do not port); credits to the Belobug and fxceless forks in ambient.rs and queue/behind.rs; and game data inside source files (title image offsets, program-name lists, shader-hash lists, run logs under diagnostics/), which must be stripped from any port.

    claim: C1, minimal version (compute whole forms without static samplers, behind a switch), from Vice-Tay 1f69d67 victory-gpu/src/pipeline/library.rs; XCL files: hle/d3d12x/real.rs beside the CachedPSO path, real/dispatch_chain.rs, a new pipeline_library.rs. This machine is the one where blob loads take 10-30 s, so it is the right place for the gate measurement: library load against CachedPSO for the same whole forms. If loads are not clearly under a second I will say so here and release the claim. Draft PR or that answer within 24 hours.

    AI use: Claude Code (a Claude Opus 5.5 sub-agent read both trees; Claude Fable 5.2 wrote this). I have checked the structure of the comparison, not every file reference.

  2. VolenNakov commented on Nov 27, 2026

    @VolenNakov

    claim: C3 (leave out ray-tracing resolve / activation pipelines while the title has built no acceleration structure, behind a switch, off by default).

    • Upstream: Vice-Tay 1f69d67, crates/victory-gpu/src/pipeline/make.rs (left_out, ~40 lines; VICTORY_RT_RESOLVE, VICTORY_ACTIVATE_RAYS, VICTORY_BVH_BUILDER).
    • XCL files I expect to touch: hle/d3d12x/real.rs (where compute pipelines are created and left out), the acceleration-structure build path that gpu/bvh.rs serves (to know whether any structure was built), plus a test.
    • Not ported as is: upstream picks the programs by a name inside the shader container; that is a program-name list, which [OFFICIAL] Swarm: ports from the VIctory line (GPL-3.0) into XCL #3011 says must stay out. I will select them by what the program does (and fall back to a user-supplied hash file, as the lab's XCL_PSO_SKIP_FILE does), so no title data goes into the source.
    • The gate first, as the candidate list asks: unlike VIctory, XCL builds console-format acceleration structures (gpu/bvh.rs) and emulates image_bvh_intersect_ray, so its rays may hit. Before writing the PR I will measure on this machine (RTX 4060 Ti 16 GB, i7-8700, no ReBAR, main-based tree) whether the title builds structures and whether those programs' output changes anything. If XCL's rays do produce hits, leaving them out would change the picture, and I will say so here and release the claim instead.
    • What it should win if the gate passes: fewer cold compiles (about 1,000 compute records in this title's pack; a local skip file of exactly these already removed a crash at +0x23cf683 for me on MacieGx's lab tree), and their GPU time per frame.

    Draft PR or the gate answer within 48 hours.

    AI use: Claude Code (Claude Opus 5.5) read both trees and wrote this; I run the tests on my machine.

  3. throny commented on Nov 27, 2026

    @throny
    CollaboratorAuthor

    C1 (pipeline library): first result, and I am releasing the claim. The minimal port exists (480 lines from Vice-Tay library.rs with its provenance header, behind XCL_PSO_LIBRARY=1, unit and GPU tests pass, an independent review found no blockers), but two runs on the title show it does not reach the pipelines that matter in XCL as it is:

    • Of 245 large compute pipelines created in a run, only 11 are eligible. The rest have a root signature with static samplers, which Vice-Tay's own notes say come back wrong from a library on NVIDIA, so the port leaves them out.
    • The premise also got weaker on this machine: with the NVIDIA shader-heap profile at 2 GiB instead of 1 GiB, creating compute pipelines of 750 KB+ of DXIL from CachedPSO takes 0.8-4.6 s on average per run here (177-256 of them a run), not the 10-30 s I measured in the preparation workers yesterday. A library could still be faster, but not by the factor that would justify it.
    • The library was never saved in these runs (fewer than 16 stores, and both runs ended in a title crash), so I have no load times to show. I am not spending more GPU time on it.

    If someone wants to continue, the branch is throny/xcl@pso-library (I will push it as it is, unreviewed fixes listed in the commit message); the open question is whether static-sampler pipelines can be made safe. Otherwise C1 is free.

    claim: C6 (CLZERO loops patched at the first fault, at that site only, atomically; from Vice-Tay 1f69d67 victory-loader/src/console_insn.rs), unless @Prime1997 wants it: say so and it is yours. Reason: it is what blocks a usable picture on Intel CPUs right now. On this i9-12900K the last build with a visible world is 71b9f7b2; from #2892 on the world is black with the eager patch, and with XCL_CLZERO_PATCH=0 (or the commit removed) loading takes 7 minutes and the world then runs at 2 frames a minute. XCL files: eh.rs, loader.rs. Draft PR or a "does not help" within 24 hours.

    AI use: Claude Code (Claude Fable 5.2); the port was written by a Claude Sonnet 5.5 sub-agent and reviewed by a Claude Opus 5.5 sub-agent.

  4. throny commented on Nov 27, 2026

    @throny
    CollaboratorAuthor

    Correction on C6, and I release that claim too. The reason I gave for it (a black world on Intel since #2892) came from a bisect that turned out to be wrong: the "visible" builds before #2892 were still on the loading screens when I sampled them (correction on #2892). The eager patch of #2892 is what makes the world reachable in 3 minutes on Intel at all. The lazy, atomic variant from Vice-Tay is written and passes its unit tests (branch throny/xcl@clzero-at-fault, pushed as it is), but it fixes no known problem now, so it is not worth a PR unless @Prime1997 or someone else wants it for robustness. C6 is free; C1 as well (see above). I will pick the next piece from the measurements, not from a guess. AI use: Claude Code (Claude Fable 5.2).

  5. ClosetPie107 commented on Nov 27, 2026

    @ClosetPie107

    AMD numbers for "What stops XCL today" (RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV, Ryzen 5 9600X, 32 GB; CachyOS, Proton Experimental experimental-11.0-20261112 with vkd3d-proton master ec207194, the lpVtbl checks for command allocators and lists dropped). main 83b00818, release, warm shader cache, XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024 VKD3D_CONFIG=ignore_shared_fence, 300 s, A pressed every 10 s, 4 runs today.

    1. No 3D picture in the intro. The audio plays and the 2D credit names appear over the intro, but the characters and the scene never show. The runtime is busy all the time: from ~100 s it mostly runs 650–4,200 draws and 3,000–17,000 dispatches per 2 s, at 1–6 presents per 2 s, and only 256 of 96,410 draws and 8 dispatches were skipped. So the title is rendering, but nothing of it reaches the screen. For comparison, VIctory (63bcca4 + its D3D12.X: share dispatch-chain root signatures per device and key compute blobs on NodeMask #2723) on this same machine yesterday played the intro cutscene lit, with characters and hair (~1 fps), then the prologue at 2.9–3.3 fps with ~12.7 GB of video memory (Shader: key every heap handle cache by element type (#177 on main, fixes the NVIDIA compute-pipeline crash) Marvisak/VIctory#2723, my comment there).
    2. Memory: ~10 GiB of video memory at 90 s, and the 16 GiB card full (16.2 GiB) later in every run.
    3. Pipelines: with a warm cache the first present comes at ~33 s. With an empty cache, the startup preparation does not finish within 2 × 20 minutes here, so on Linux a first run without a filled cache never reaches the title.
    4. Stability: 0 crashes in today's 4 main runs. Crashes seen on this machine in other runs: game_scarlett_master.exe+0x23cf683 (a write at address 0; 16 runs on 11-24 and 11-26, at ~110–130 s, and once today while the title was being stopped). @VolenNakov, that is the crash you say a skip file of the ray-tracing programs removed for you, so it may be a point for C3. Also a copy in ucrtbase.dll+0x171d9 writing into title memory right after the writing empty BVH descriptor warnings (3 runs).

    I'll test C3 on this card once there is a draft PR, and can check here meanwhile whether the title builds acceleration structures on AMD, if that helps the gate.

    AI use: Claude Code (Claude Opus 5.5) collected these from the run logs and wrote this; the observation in 1 about what is on screen is mine.

  6. coolpersonnn commented on Nov 27, 2026

    @coolpersonnn
    Contributor

    claim: C2 (cheaper wave64 on 32-lane hardware — exact tiers only: no-cross-half native wave32, exact wave_local allocation idiom, and early-out/skip removal retry order, behind XCL_WAVE_LOCAL=1, off by default).

    • Upstream: Vice-Tay 1f69d67 (inheriting from VIctory 63bcca4 and victory-fork 9a9091d, GPL-3.0-or-later): crates/victory-shader/src/emit/lower.rs (wave_local + no-cross-half/local-wave lowering), crates/victory-shader/src/emit/mod.rs (exact retry order), crates/victory-shader/src/ir.rs (without_early_outs, without_skips).
    • XCL files I expect to touch: new crates/xcl/src/gpu/recomp/wave_local.rs (+ THIRD_PARTY.md), crates/xcl/src/gpu/recomp/mod.rs, crates/xcl/src/gpu/recomp/pso.rs, crates/xcl/src/gpu/dxil/kernel.rs, crates/xcl/src/gpu/dxil/lanes.rs, crates/xcl/src/gpu/recomp/lower_dxil.rs, crates/xcl/src/gpu/recomp/lower.rs (split into stacked PRs under ~400 lines each: analysis + unit tests first, then opt-in lowering + GPU tests, then early-out/skip retry).
    • Gate first: Before opening the first draft PR I will measure on this RTX 5090 / Ryzen 9 9950X3D (Windows) how many compute programs in the corpus qualify for each exact tier and compare DXIL size, --measure-pso compile time, and GPU execution time against Partner::Spin. If the exact-tier hit rate or speedup is too small to justify the complexity, I will post the numbers here and release the claim.
    • ETA: Gate numbers and first draft PR within 24–48 hours.

    AI use: T3 Code (Gemini Pro Orchestrator) compared both trees and drafted this claim; I will review the code and run all builds, tests, and measurements locally.

  7. VolenNakov commented on Nov 27, 2026

    @VolenNakov

    C3: the draft PR is up as #3026 (XCL_RT_LEAVE_OUT, off by default).

    • The gate passed on my machine. The title names 5 acceleration structures, and none got a root node in 900 s, so every ray misses. XCL now warns once in the log if one ever does. The hit-shading programs do not trace rays themselves.
    • A hands-off A/B on an RTX 4060 Ti 16 GB with an i7-8700, same build, the switch the only difference: world presents/s went from 3.98 to 5.25 (+32 %), and driver compiles started during the run from 957 to 418. No errors, removals or wait timeouts.
    • Selection: the programs are named by the user's fragments, so no title names are in the source.
    • Not tested: the picture (the world is grey on this tree), a cold-cache preparation, later scenes, AMD. Testers welcome, especially on a cold cache.

    AI use: Claude Code (Claude Opus 5.5) wrote the port and ran the tests on my machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions