Repository navigation
Mario Kart World maps no memory past its application pool (mem_map_limit on): free roam's footprint stays near 4 GB - #1594
lossefanya wants to merge 1 commit into
Conversation
…mit on): in free roam the game frees its own blocks, and its footprint stays near 4 GB with DM_GUEST_FILE Free roam streams the world, and the memory kept growing: on a 16 GB M1 Pro, handheld, a scripted drive into new areas took the footprint from 7.8 to 9.4 GB in 12 minutes (the game's charged memory 3.9 to 5.3 GB, 4.5 GB compressed, swap growing). Most of it was the game's own memory, which the host cannot give back without knowing what the game still needs. With mem_map_limit on, MapPhysicalMemory past the 9 GB pool fails as on Horizon, and the game's streaming frees its own blocks: its alias region peaked at 1.5 GB mapped where it had 3.0 GB, as issue seedds#1536 found on an 8 GB Mac. With DM_GUEST_FILE=1 as well, the footprint stayed at 3.8 to 4.4 GB over 13 to 17 minutes, compressed memory under 0.6 GB, swap flat, wired unchanged. The cost is more long frames: a 20-minute played windowed run (Grand Prix and free roam) had 1.35 long frames a second (21 over 100 ms) against 0.65-0.73 without the files. Measured on a branch that also had pull requests seedds#1179, seedds#1229, seedds#1230, seedds#1251 and seedds#1350. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8eae18f to
3e8f2e9
Compare
|
Does it run 60fps on m1 pro? |
near 60. In grand prix, around 57, depends on map. |
|
I was asking because grand prix only reaches 42-43FPS at best on my M1 pro |
Right, this PR fixes memory issue but lowers performance. |
…es span every channel of their submap (GitHub PR seedds#60) stb_vorbis cut a type-2 residue's interleaved vector at n * 2 values even when its submap holds more channels, so the rest of the packet was read as the wrong data: the 5.1 tracks libvorbis encodes came out distorted and gurgling, with pops. The bound is now n * ch, as in the Vorbis spec and libvorbis's res2_inverse, and the temporary-memory estimate for a caller-owned buffer counts every channel of the stream for type-2 residues (with the decode fix alone, a 6-channel stream overran the advertised buffer). Upstream stb still has the bug (nothings/stb seedds#879, seedds#1594). Link's Awakening's opening and title movies were the report; DRAGON QUEST XI S's movies open only 6-channel Vorbis tracks too. Its 23 6-channel cutscene and title tracks, decoded as the host does, now match FFmpeg to within 0.02 PCM16 units, where main's decoder was off by an RMS of 1,700 to 70,000 units. dm/host/tests/t_vorbis builds tiny Vorbis streams in memory (types 0/1/2, mono to 8 channels, two submaps) and checks heap and fixed-buffer decoding through the pull and push APIs, with and without STB_VORBIS_DIVIDES_IN_RESIDUE; it needs no game profile. dmhost rebuilds when stb_vorbis.c changes. On top of the PR: the test rules sit with the others, and the stb_vorbis README and the per-game notes say what the fix repairs. Co-authored-by: ohxiaoguang <44696970+ohxiaoguang@users.noreply.github.com>
…es span every channel of their submap (GitHub PR seedds#60) stb_vorbis cut a type-2 residue's interleaved vector at n * 2 values even when its submap holds more channels, so the rest of the packet was read as the wrong data: the 5.1 tracks libvorbis encodes came out distorted and gurgling, with pops. The bound is now n * ch, as in the Vorbis spec and libvorbis's res2_inverse, and the temporary-memory estimate for a caller-owned buffer counts every channel of the stream for type-2 residues (with the decode fix alone, a 6-channel stream overran the advertised buffer). Upstream stb still has the bug (nothings/stb seedds#879, seedds#1594). Link's Awakening's opening and title movies were the report; DRAGON QUEST XI S's movies open only 6-channel Vorbis tracks too. Its 23 6-channel cutscene and title tracks, decoded as the host does, now match FFmpeg to within 0.02 PCM16 units, where main's decoder was off by an RMS of 1,700 to 70,000 units. dm/host/tests/t_vorbis builds tiny Vorbis streams in memory (types 0/1/2, mono to 8 channels, two submaps) and checks heap and fixed-buffer decoding through the pull and push APIs, with and without STB_VORBIS_DIVIDES_IN_RESIDUE; it needs no game profile. dmhost rebuilds when stb_vorbis.c changes. On top of the PR: the test rules sit with the others, and the stb_vorbis README and the per-game notes say what the fix repairs. Co-authored-by: ohxiaoguang <44696970+ohxiaoguang@users.noreply.github.com>
…ation pool (mem_map_limit on) (seedds) A bug fix: the host mapped memory past the 9 GB pool where Horizon refuses, so the game's streaming never freed its own blocks and free roam grew without bound (7.8 to 9.4 GB in 12 minutes on a 16 GB M1 Pro, the author's measurement). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcmewFJDrDUooyBk9ygMAv
…ation pool (mem_map_limit on) (seedds) A bug fix: the host mapped memory past the 9 GB pool where Horizon refuses, so the game's streaming never freed its own blocks and free roam grew without bound (7.8 to 9.4 GB in 12 minutes on a 16 GB M1 Pro, the author's measurement). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcmewFJDrDUooyBk9ygMAv
…ation pool (mem_map_limit on) (seedds) A bug fix: the host mapped memory past the 9 GB pool where Horizon refuses, so the game's streaming never freed its own blocks and free roam grew without bound (7.8 to 9.4 GB in 12 minutes on a 16 GB M1 Pro, the author's measurement). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcmewFJDrDUooyBk9ygMAv
…ation pool (mem_map_limit on): free roam's footprint stays near 4 GB The settings table drops the PR's render_cond row (the key is gone on main); its Memory in free roam section follows the Frame rate section.
|
Thanks @lossefanya for diagnosing Mario Kart World's free-roam memory growth and sharing your measurements. Closing this PR because Still open: free roam's frame rate and an isolated memory check without |
…ile): closed, superseded by a694f17 (seedds#3188: Horizon's application-pool memory limit on by default for every Switch 2 game); its free-roam measurement goes with it
…d first; Store.slim (seedds#2470) reads main's v2 cache schema; chain 2d0bb91984e7 -> ce42b3f44d72 Reverted before this merge (each its own commit): on main in its own form or superseded: seedds#1978 (1e06abd), seedds#3195 (8c7660d, discussion seedds#3291), seedds#2140 (62bcfd2), seedds#1594 (a694f17), seedds#1847's host changes (473c90d, 1999cbd), seedds#2173 (main's discussion-fed list), ef13ece's port of seedds#2390 (5fa41f3); closed upstream with nothing on main, at the user's choice: seedds#1827, seedds#1765, seedds#1642, seedds#1847's Bananza render scale (7984715), seedds#1717, seedds#2251, seedds#2259, seedds#2226. Conflicts: the frame lag ring (seedds#2074) beside main's acquire-next receipts (1999cbd): frame_lag_wait after main's offscreen early return, frame_lag_note before main's next_ticket bookkeeping, nvn_queue_present_hold / ticket_fence beside main's nq_receipt_wait_published; the prebuild tool's timer still writes nothing (da2808f) beside main's batched archive writes (4d62497), whose removal of the 1,000-capture flushes matches fa1df04; t_pso_archive runs both tool_write_waits_for_compiles and batch_wave; seedds#2470's slim argument kept beside main's pruning step and GL shader build; tests.yml takes main's list plus t_lag; t_audio_device keeps test_route_choice (main moved wait_for_phase up); development.md takes main's compressed-cache sentence plus seedds#2470's; rendering.md keeps seedds#2388's "3D upscaler" label in main's new text; the chain header is main's (dmsh_chain.py --header gives the same value). Merge fix: Store.slim measured index entries with length(b.data), a column main's v2 schema (5fa41f3) renamed to payload; it now picks the column as prune_shaders does, and its test counts stored bytes.
What and why
Refs #1536.
Symptom. In free roam, Mario Kart World's memory keeps growing as the world streams in. On a 16 GB M1 Pro the footprint went from 7.8 to 9.4 GB in 12 minutes, macOS compressed 4.5 GB of it, and swap grew. Most of it is the game's own memory (charged 3.9 → 5.3 GB); the host's GPU memory grew only 0.3 GB. Grand Prix races do not show it.
Cause.
MapPhysicalMemorypast the 9 GB application pool succeeds on the host, where Horizon fails it, so the game's streaming keeps mapping new blocks instead of freeing its own.Change. The profile sets
mem_map_limit on, a key five profiles already use. The host and tools are unchanged. The alias region now peaks at 1.5–1.75 GB mapped instead of 3.0 GB, which matches what #1536 found on an 8 GB Mac. The game note gets a row in its settings table and a new section, Memory in free roam.Checked
Mario Kart World v0, free roam, handheld (
DM_OPMODE=0), M1 Pro 16 GB, macOS 27.2.DM_GUEST_FILEb2d46b86+ this,DM_GUEST_FILE=1DM_GUEST_FILE=1dm/tools/tests/test_game_profile.py,test_docs.py.DM_GUEST_FILE. With the files on, the footprint counts no file pages, so the limit's own effect shows in the alias region's peak, not in the footprint.DM_GUEST_FILE: more long frames late in a session (1.35/s over 20 minutes vs 0.65–0.73/s without) and about 8 GB of temp files while the game runs. The note says so; it stays a player's choice.Frame rate (not changed by this PR)
For context, on the branch with the other PRs cherry-picked (row 3 above):
gpu_timestamps segment; with it, distant scenery flickered), and Mario Kart World's cube-map prefilter is drawn one face at a time: profile key split_outputs #1251 needed its MSL extracted by hand.Docs
docs_symptoms.pyshows no change (no reference entry)🤖 Generated with Claude Code