Skip to content

Unload far-away areas past a budget and regenerate them in place - #47

Merged
valuecodes merged 2 commits into
mainfrom
feat/area-unloading
Oct 14, 2026
Merged

valuecodes merged 2 commits into
mainfrom
feat/area-unloading

Conversation

@valuecodes

Copy link
Copy Markdown
Owner

What

  • Part 5/5 of Post-MVP additions: unload areas the player has left behind, so a large repository no longer grows the JS heap (~1.4 MB per built area) and GPU geometry/textures without bound.
  • AreaStore.evict drops a built area but keeps its reserved place; ensure regenerates it deterministically at the same offset, so rooms, portals and return points are unchanged. AreaWorld.unloaded lists them; zones, checkAreas and the maps treat them as built (outlines with data-area-state="unloaded", counted in n/total).
  • createUnloader (area-budget.ts) keeps at most 12 areas loaded, least recently visited first. Pins are bounded: entry, the player's area, navigation's unit, the top frame's ends and the portal ahead. Backspace and return portals generate the top caller's area first.
  • Pre-generation on sight stays for pending areas only; an unloaded area regenerates when stepped into, so looking along a wall of portals does not churn.

How to test

pnpm typecheck
pnpm lint
pnpm knip
pnpm test
pnpm build
pnpm --filter web dev # open http://localhost:3000/?code=self&stats=1, walk through more than 12 module portals: areas holds near 12, geo/tex level off, walking back regenerates an area in the same place (Tab map)

Security review

No security-impacting changes.

🤖 Generated with Claude Code

valuecodes and others added 2 commits October 14, 2026 15:43
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 14, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T13:09:57.993195Z 35a5908 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@valuecodes
valuecodes merged commit 2ad8b27 into main Oct 14, 2026
10 checks passed
@valuecodes
valuecodes deleted the feat/area-unloading branch October 14, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants