feat(scripts): memtour.py, a memory tour through the control bridge #570
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8015c9a
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!570
Loading…
Reference in a new issue
No description provided.
Delete branch "tonesi/Longshot:feat/memtour"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: feat · Risk: low · Tested on: Linux, RTX 3070 Ti · Needs: none
Why
"The game outgrows my RAM and the swap fills" (issue 388) can only be answered, and a fix only checked, with the same tour run the same way on each PC and build. This is that tour as one command, on top of the control bridge, so a tester needs no private harness. See #388. The tracker was searched (issues and pull requests, all states, for memory, RAM, swap, tour, sampler, control bridge): none adds a memory tour. Related, not the same: #562 shows the game's own CPU and RAM in an FPS-counter page and writes them to a file from inside the game, with no swap, no shared-memory split and no tour; this reads
/procfrom outside, over a scripted route. #416 is the change that was measured with this tour first.What changed
A new script starts a game folder through the control bridge, loads a save, walks through some areas and writes down the game's memory as it goes. Its test needs no game.
scripts/memtour.py(new): starts the game withlongshot_ctl.py'sstart_session(test profile: headless, a copy of the save, the source only read), presses A until the save is loaded (Tour.to_play), teleports through--dests(default13,1,2,3,0,7,9,11, orall) with a walk and camera swings in each, then quits.Samplerwritesmem.csvevery 2 s from/proc/<pid>: RssAnon, RssShmem, swap (anonymous and shared),game_total(resident + swapped, file pages left out), MemAvailable, swap in use.marks.csvhas the tour's events;summary.md(summarize) the peaks and each area's peak, end value and lowest MemAvailable. Linux only: it reads/procand says so elsewhere.tests/test_memtour.py(new): the sampler against a made-up/proc; the tour against a fake bridge (A presses until the save loads, a refused teleport retried, one refused for good skipped, a save that never loads, an error reply); the summary's numbers per area.docs/development.md: one row in the commands table.Measurements
Verdict: nothing to measure: a script and its test, and no game code changes. (One real run of the script is under Testing.)
Flags and settings
None.
Testing
Tested: on Linux (RTX 3070 Ti 8 GB, 15 GB RAM),
python -I -B tests/run_all.py: 483 passed, 5 failed, 84 skipped (no clang, Vulkan or SPIR-V headers here). Four of the failures also fail on a cleanforge/main(test_oot_saves,test_bake_portability,test_cpm_discovery,test_walk_key);test_crash_recordfailed once under 8 parallel checks and passes alone.test_memtour.py,test_longshot_ctl.pyandtest_control.pypass (after the rebase onto8b619764, the first two again). In the game, one run:python -I scripts/memtour.py <game folder built from main 0caf0618> --save <Zora's River save> --dests 13,1 --dwell 15 --settle 10loaded the save, teleported to Zora's Domain and Hyrule Field, quit cleanly and wrote the three files (peak game total 9,491 MB, lowest MemAvailable 840 MB, 39 samples).Not tested: Windows (the script refuses, by design); a first start that prepares shaders before the first frame (
--launch-timeoutis there for it); runs of more than a few minutes through this script (the long tours behind issue 388 used a private harness that this replaces).Must be tested: None.
Risks
What could break: nothing the game or the build uses: a new script, its test and a docs row. The test is discovered by
run_all.pyand runs in under a second.Turning it off: revert the commit.
Compatibility: Nothing changes.
Issues
See #388
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.🤖 Generated with Claude Code
Measurements section filled in (a script: measured by its game-free checks and one real run), 'Measured' ticked, no testers needed.
ef5809ac4233da09baabRebased onto
8b619764and the description rewritten to the new template. Measured: a script, so its verdict says there is nothing to measure; no testers needed. Tracker searched; PR 562 (in-game system readings) named as related, not overlapping.WIP: feat(scripts): memtour.py, a memory tour through the control bridgeto feat(scripts): memtour.py, a memory tour through the control bridgeView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.