RAGE's own DEBUG INFO, live: VICTORY_RAGE_DEBUGINFO=<seconds> (streaming requests, tile heap, pools, camera, mission) in the log and window caption #643

Open
github-bot wants to merge 1 commit from github-bot/gh-643 into main AGit
Owner

@⁠Jonirulah on GitHub · 2026-11-25 03:50 UTC · original
Jonirulah:rage-debuginfo-live → main · +81 −2 · 4 files · 1 commits · open

RAGE already reports its state. This reads it while the title runs, instead of only after a crash.

The title's crash handler writes a ###### DEBUG INFO ###### block: game state, frame, streaming requests, tile heap used/total, entity pools (INSTANCE_LIST, OBJECT, LIGHT...), camera position and front, mission and stage, script threads, player, console type. So far it has only been seen in *.crash.log after a crash, and several issues quote it from there.

With VICTORY_RAGE_DEBUGINFO=<seconds> (diagnostics builds), a thread of ours calls the title's own builder (RVA 0x21b9a40 in 1.0.2.1) every N seconds:

  • each line goes to stderr as RAGE: ..., next to our frame lines;
  • the useful figures go in the window caption: | RAGE frame 1014 stream 722 tileheap 3881/3977 MB Game Running.

VICTORY_RAGE_DEBUGINFO_RVA (hex) overrides the address for another build.

Why it's safe to call live: each section reads a cache the title keeps, under a try-lock (lock cmpxchg on its flag). If the title holds the lock, the section writes Cache is locked! Skipping! and moves on, so the call never waits on the title. The builder uses no TLS. Its printf goes through one global 4 KiB buffer of the title's, so only one thread of ours calls it. The first call waits 20 s.

What it showed (RTX 3070 Laptop 8 GB, Series S, first room): tile heap 3881/3977 MB with 722 streaming requests pending, then 3560 MB and 27 pending ten seconds later. MEMORYINFO stays 0 outside a crash; the other sections update live. That makes it useful for questions like the first room's walls: whether RAGE never asked for them, has them queued, or has them loaded and they still aren't drawn.

Changes: apps/victory/src/run.rs (diagnostics only), set_caption_extra in victory-gpu (host.rs, lib.rs), re-exported from victory-hle. Release and diag builds pass on main (310c6eb).

shortcut: the RVA is specific to 1.0.2.1, and nothing checks a signature before the call.

AI-assisted: the builder, its sections and their locks were found with Ghidra by a second Claude session; Claude Code wrote and tested the change, and I ran the game.

**@⁠Jonirulah** on GitHub · 2026-11-25 03:50 UTC · [original](https://github.com/fxceless/victory-fork/pull/643) `Jonirulah:rage-debuginfo-live` → `main` · +81 −2 · 4 files · 1 commits · open **RAGE already reports its state. This reads it while the title runs, instead of only after a crash.** The title's crash handler writes a `###### DEBUG INFO ######` block: game state, frame, streaming requests, tile heap used/total, entity pools (`INSTANCE_LIST`, `OBJECT`, `LIGHT`...), camera position and front, mission and stage, script threads, player, console type. So far it has only been seen in `*.crash.log` after a crash, and several issues quote it from there. With `VICTORY_RAGE_DEBUGINFO=<seconds>` (diagnostics builds), a thread of ours calls the title's own builder (RVA `0x21b9a40` in 1.0.2.1) every N seconds: - each line goes to stderr as `RAGE: ...`, next to our frame lines; - the useful figures go in the window caption: ` | RAGE frame 1014 stream 722 tileheap 3881/3977 MB Game Running`. `VICTORY_RAGE_DEBUGINFO_RVA` (hex) overrides the address for another build. **Why it's safe to call live:** each section reads a cache the title keeps, under a try-lock (`lock cmpxchg` on its flag). If the title holds the lock, the section writes `Cache is locked! Skipping!` and moves on, so the call never waits on the title. The builder uses no TLS. Its printf goes through one global 4 KiB buffer of the title's, so only one thread of ours calls it. The first call waits 20 s. **What it showed** (RTX 3070 Laptop 8 GB, Series S, first room): tile heap 3881/3977 MB with **722 streaming requests pending**, then 3560 MB and 27 pending ten seconds later. `MEMORYINFO` stays 0 outside a crash; the other sections update live. That makes it useful for questions like the first room's walls: whether RAGE never asked for them, has them queued, or has them loaded and they still aren't drawn. Changes: `apps/victory/src/run.rs` (diagnostics only), `set_caption_extra` in `victory-gpu` (`host.rs`, `lib.rs`), re-exported from `victory-hle`. Release and diag builds pass on `main` (`310c6eb`). shortcut: the RVA is specific to 1.0.2.1, and nothing checks a signature before the call. AI-assisted: the builder, its sections and their locks were found with Ghidra by a second Claude session; Claude Code wrote and tested the change, and I ran the game.
The title's crash handler writes a "###### DEBUG INFO ######" block: game
state, frame, paused, streaming requests, tile heap used/total, memory
pools, console type, camera position and front, mission and stage, script
threads, player, the entity pools (BUILDING, OBJECT, LIGHT, INSTANCE_LIST
...), peds and vehicles. Until now it was only seen after a crash, in the
crash log. Its builder is the title's routine at RVA 0x21b9a40 in 1.0.2.1;
it takes a writer { buf, cap, used } and calls each section in turn.

With VICTORY_RAGE_DEBUGINFO=<seconds> (diagnostics builds) a thread of ours
calls it every that many seconds with a 64 KiB writer of its own, prints
each line as "RAGE: ..." beside our frame lines, and puts the figures worth
watching while playing in the window caption:
" | RAGE frame 1014 stream 722 tileheap 3881/3977 MB Game Running".
VICTORY_RAGE_DEBUGINFO_RVA (hex) points it elsewhere for another build.

Why it is safe enough to call while the title runs: every section reads a
cache the title keeps, taken with a try-lock (lock cmpxchg on its flag);
when the title holds it, the section writes "[Warning] Cache is locked!
Skipping!" and goes on, so the call never waits on the title. The builder
uses no thread-local state. Its printf formats through one global 4 KiB
buffer of the title's, so only this one thread calls it; a crash at the
same moment could interleave text, not hang. The first call waits 20 s,
past the title's start-up.

What it showed on an RTX 3070 Laptop 8 GB, Series S, first room: tile heap
3881 of 3977 MB used with 722 streaming requests pending, then 3560 MB and
27 pending ten seconds later. MEMORYINFO reads 0 outside a crash (the title
fills that cache only then); SYSTEM INFO, MISC INFO, MISSION, POOLS and the
rest update live. The builder, its sections and their locks were found with
Ghidra on the title.

shortcut: the RVA is the 1.0.2.1 title's; another build needs
VICTORY_RAGE_DEBUGINFO_RVA. There is no signature check before the call.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:48:03 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/643/head:github-bot/gh-643'
git switch 'github-bot/gh-643'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-643'
git switch 'github-bot/gh-643'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-643'
git switch 'github-bot/gh-643'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-643'
git switch 'main'
git merge --squash 'github-bot/gh-643'
git switch 'main'
git merge --ff-only 'github-bot/gh-643'
git switch 'main'
git merge 'github-bot/gh-643'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.