Skip to content

b8b1f49 (structured jumps to outer loop heads): the retail title of #505 commits ~1 GB/s until XCL runs out of memory, before the world load #1307

Done

Description

@VolenNakov

RTX 4060 Ti / Windows: with b8b1f49 the host's commit grows about 1 GB per second from ~20 s on, with the working set flat, until memory allocation of … bytes failed (0xc0000409) at ~120–150 s. The title never reaches the world load. With only b8b1f49 reverted on the same tree, commit levels off at ~31 GB and the world load starts at 112.9 s again. Two runs with the commit, one without, same settings and caches.

Setup

Commit of the title's host (GB)

s with b8b1f49 (run 7) without (run 8)
31 14.4 13.2
61 37.7 19.2
90 69.1 24.8
121 99.3 30.1
151 113.7 31.0

Working set with b8b1f49: 18.8 → 21.0 GB from 61 s to 151 s, while commit grew by 76 GB, so the growth is committed memory that is not touched. Free system commit reached 0.3 GB at 113 s.

Runs

run 6 (with) run 7 (with) run 8 (without)
first ListX #101 (not on PC) (world load) none none 112.9 s
last console-code report 21 100 draws, 2 048 dispatches (96.6 s) 21 301 draws, 2 048 dispatches (105.1 s) 16 705 draws, 8 192 dispatches (115.6 s)
skipped draws / dispatches, GPU wait timeouts 0 / 0, 0 0 / 0, 0 0 / 0, 0
end memory allocation of 1327304 bytes failed, ~120 s memory allocation of 1441792 bytes failed, ~150 s +0x23cf683 at 144.4 s, 1.3 s after a 20.9 s compute PSO build in the run (a pipeline whose DXIL changed back with the revert)
  • In both runs with the commit the title presents at 25–30 fps until the end (2700 frames presented at 110 s / 121 s) but goes no further than the loading it does before #101.
  • The log has nothing that grows with the commit. The first sign is the end itself: from 133 s in run 7, no video memory for more pages of title textures (0x8007000E) (42 times), CreateHeap … refused, and DirectStorage requests failing with 0x800705aa, all after free commit was gone.
  • Runs 4 and 5 on this machine (the same tree before main moved, so without b8b1f49) reached #101 at 104 s and 156 s and ran 137–187 s with no memory error.

Not tested

  • Plain main with and without b8b1f49; AMD or Intel GPUs; Wine.
  • Which allocation grows. With the commit, NVIDIA's driver builds of the restructured programs were not faster here: 0.76–0.98 MB of DXIL took 141–294 s each in xcl pipelines, as before.

Logs, report.json and the 2 s memory samples of runs 6–8 can be attached on request.

AI use

  • Claude Code with Claude Opus 5.5: built the trees, ran and sampled the runs on my PC, read the logs and wrote this report.

Activity

  1. tiagonogueiraa-bit commented on Nov 24, 2026

    @tiagonogueiraa-bit

    claiming: I'll translate the retail pack's programs on the CPU (no GPU needed) with main and with b8b1f49 reverted, to find the programs whose structured HLSL grows, or whose translation grows, far past the dispatcher form. I'll post the numbers here, then a fix: most likely a bound that falls back to the dispatcher for those programs.

    Written with Claude Code (Claude Opus 5.5).

  2. tiagonogueiraa-bit commented on Nov 24, 2026

    @tiagonogueiraa-bit

    Found it on the CPU side: one compute program's structured HLSL is 148 MB since b8b1f49. I translated every program of the retail pack's shaders.rpf with gpu::recomp built on its own (macOS), from main and from main with b8b1f49 reverted.

    • indirect_diffuse_lighting:CS_ScreenProbes_ActivateRays… (334 KB of code): 148.5 MB structured, against 13.8 MB as pc blocks (b8b1f49 reverted). Translating it takes 1.5 s either way, so the cost lands in DXC and the driver. No other program grows by more than 1.4×.
    • The size is in the guards. The structured form wraps what follows a forward jump in if (!(xcl_skip_a || xcl_skip_b || …)) {, listing every pending skip flag, and reopens it whenever the set changes. Here there are 3 861 flags and 14 036 guards of up to 597 terms (152 on average), 99 MB in guard lines. It grows with the square of the pending flags. A synthetic program of n crossing forward jumps reproduces it.

    PR #1321 bounds it: structured code over 128 bytes per byte of program (this one: 455; the next largest in the pack: 61) is translated as pc blocks. Over the pack only this program changes, to 13.8 MB, and b8b1f49's gain stays (170 programs as pc blocks, against 1 670 before it). @VolenNakov, if you can, a run of your A/B with #1321's head would confirm the title's commit levels off again.

    Written with Claude Code (Claude Opus 5.5).

  3. CuteBooty commented on Nov 24, 2026

    @CuteBooty

    A data point from plain main with b8b1f49: one run, the growth from ~20 s did not show, and the world load was reached.

    • NVIDIA GeForce RTX 3070 8 GB (driver 621.24), Ryzen 5 3600, 32 GB RAM (commit limit about 49 GB, page file can still grow), Windows 11 build 26200. Release build of main 930e8b49c1c2ec683d22c724a398b39111cd0e56 with nothing on top, DXC 1.9.2602 (Windows SDK). Retail 1.0.2.1, XCL_NETWORK=0 XCL_ACTIVITY=1, no XCL_PSO_WAIT_MS, input by hand.
    • Commit of the process, from XCL's own memory: lines:
    s GB (1 GB = 1000 MB)
    20 15.2
    30 15.5
    60 16.1
    90 16.4
    110 17.0
    120 20.6
    150 26.5
    180 29.2
    200 29.6 (highest sample)
    • Heavy loading starts at about 112 s. First ListX #101 (not on PC) at 170.8 s. Last frames in the sample ending at 174 s. The run ends at +0x23cf683 at 203.3 s, 0 device removals. Lowest free system commit 6.1 GB.
    • For comparison, one run of main d208e14 (before b8b1f49, many other commits between) on the same machine peaked at 29.5 GB.

    Limits: one run, no A/B of b8b1f49 alone. 608 shader sets from earlier runs were built ahead of use here, not the whole journal as in your setup, so I can't say whether this run compiled CS_ScreenProbes_ActivateRays… at all. This does not contradict #1321's finding.

    AI use: Claude Code (Claude Opus 5.5) ran it with me at the machine, read the log and wrote this comment.

  4. VolenNakov commented on Nov 24, 2026

    @VolenNakov
    Author

    Confirmed: with #1321 (156b0de) the title's commit levels off again and the world load is back. Same machine, tree and settings as the A/B above; run 9 is run 7's tree plus #1321 merged, nothing else.

    commit of the title's host (GB) run 7: with b8b1f49 run 8: b8b1f49 reverted run 9: with b8b1f49 + #1321
    30 s 14.4 13.2 15.9
    60 s 37.7 19.2 19.7
    90 s 69.1 24.8 27.7
    120 s 99.3 30.1 32.0
    peak 115.8, then out of memory 31.1 32.9
    first ListX #101 (world load) none 112.9 s 95.0 s
    skipped draws / dispatches, GPU wait timeouts 0 / 0, 0 0 / 0, 0 0 / 0, 0
    end memory allocation of 1441792 bytes failed +0x23cf683 at 144.4 s +0x23cf683 at 143.3 s

    Not tested: plain main + #1321 (this tree also has the open PRs listed above), other GPUs.

    AI use

    • Claude Code with Claude Opus 5.5: built the tree, ran and sampled the run on my PC and wrote this comment.
  5. CuteBooty commented on Nov 24, 2026

    @CuteBooty

    Correction to my run above: on newer main a growth like this one shows here too. Four release runs on the same machine (RTX 3070 8 GB, driver 621.24), scripts/smoke.ps1, XCL_PRESS_A_AT=15 and otherwise no input. My script stops XCL when less than 4 GB of commit is free; it stopped all four.

    build last commit of the process (GB, 1 GB = 1000 MB)
    main b7aa9f3 31.9, 29.1
    b7aa9f3 + my #774 rework (one commit, real.rs only, not pushed) 30.9, 32.3
    • From the logs kept, the two runs of the second build (XCL's own memory: lines): 21.8 GB at 30 s and 30.9 GB at 34 s in one, 19.6 GB at 30 s and 32.3 GB at 36 s in the other, so about 2.3 GB/s at the end, with video memory flat at 6.1 GB local. They were stopped at 34 and 36 s.
    • 718 shader sets from earlier runs were built ahead of use (608 in my earlier run). That may be the difference; I did not test it.
    • So please don't read my earlier run as the growth being absent on this machine.

    Not tested: b8b1f49 reverted, #1321, or which program the memory goes to, so I can't say it is the same cause.

    AI use: Claude Code (Claude Opus 5.5) made the runs, read the logs and wrote this.

  6. grahamster2 commented on Nov 24, 2026

    @grahamster2
    Collaborator

    DXC cost of the programs discussed above, measured on their own, for ranking #1321, #1345, #1315 and #1526.

    How it was measured

    program / form HLSL DXC time DXC peak private DXIL
    CS_ScreenProbes_ActivateRays, main 152.0 MB stopped at 14 s by the floor 17.6 GB and still rising –
    same, with #1345 50.5 MB 260 s 2.3 GB 13.4 MB
    same, as pc blocks 14.1 MB 53 s 1.95 GB 12.0 MB
    CS_ScreenProbes_ActivateProbes, main 29.6 MB 78 s 3.6 GB 21.3 MB

    Where the 152 MB goes: 104 MB is in 14 780 if (!(xcl_skip_…)) guard lines, up to 597 terms each and 383 on average. ActivateProbes has 9 such guards: it is large without the guards.

    Link to the world-start stall: at runtime, on an RTX 3080 10 GB / 32 GB machine, the same ActivateRays HLSL (151 MB in the runtime's form) is compiled while the world starts. Physical RAM then drops from about 6 GB free to under 1 GB, and every other pipeline build in flight stalls. Several hundred ExecuteIndirect pipelines stay unbuilt for the rest of the run. When a local guard refused HLSL over 16 MB, that one compile no longer took the RAM.

    Not measured: the driver compile of the 12–21 MB DXILs above. #1315 reports a 29.75 MB DXIL not finishing in 600 s, so #1321 or #1345 alone still leaves a large driver compile. I also didn't measure -O1 (#1526).

    Measured and written with Claude Code (Claude Opus 5.5); the dump filter is local only, and no shader content is attached.

  7. zGLados commented on Nov 24, 2026

    @zGLados

    AMD data point on current main: the growth shows on RDNA3 too. The runs above are all NVIDIA.

    • AMD Radeon RX 7700 XT (RDNA3, native wave64), driver 32.0.32015.7029; Ryzen 7 7700X, 32 GB; Windows 11 26300; release build of main 9e3831e with nothing on top; DXC 1.9.2602.17 (Windows SDK). Retail 1.0.2.1, scripts/smoke.ps1 for 300 s, XCL_PRESS_A_AT every 6 s from 10 to 118 s. Caches were cold for this build, because Recompiler: memory windows from the descriptor heap (no per-access switch) #680 changes the HLSL.
    • Commit of the title's host: flat at ~18 GB until ~60 s, then about 1.7 GB/s: 25 GB at 70 s, 37 GB at 85 s, 54 GB at 95 s. My guard stopped the process at 63 GB at 100 s. Presents per 2 s at the end: 47, 11, 2. No device removal, no crash.
    • On the same build, xcl shaders shaders.rpf --precompile --only cs --limit 22824 with XCL_DXC_THREADS=2 reaches 32 GB within 40 s once it gets to the records after 22800, where 95cc13288a27a96e is. I did not check which program the title was compiling when it grew.
    • For comparison, on 930e8b4 with warm caches (the 300 s runs in my Recompiler: one skip variable for all forward jumps of structured code #1345 report), the title ended at its stall watchdog at ~118 s with a peak commit of 29.8 GB, before any growth.

    Not tested: #1321 or #1345 on top of 9e3831e.

    AI use: Claude Code (Claude Opus 5.5) ran the build and the runs on this machine and drafted this comment.

  8. phantom54 commented on Nov 24, 2026

    @phantom54

    what i tried: merging latest (6c89285) with suggested PR #1321 (69a892c) and it did fix the memory "leak"
    13700F + 2070 Super (32.0.16.2114)
    Windows 11 26H2 (26300.10075)

  9. ivall commented on Nov 24, 2026

    @ivall
    Collaborator

    Fixed on main by #1321, merged as e9e94ce: the program that made the commit grow is back at 15 MB of source instead of about 150 MB. The runs reported on #1321 show the commit levelling off.

    Thank you for the A/B with the one commit reverted; it named the cause. Closing. What grows later at world load (driver builds: #1598, #1657) is a different problem and stays open there.

    AI use: Claude Code (Claude Opus 5.5) wrote this comment.

  10. added a commit that references this issue on Nov 24, 2026
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