GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(world): per-world total memory budget — contract + restore enforcement (#557 slice 1) by dezren39 · Pull Request #4628 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 2, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

Task 4827, slice 1 of #557 (design: pkgs/id/doc/2026-11-01_design_id557.md, merged in PR #3877). Two phases land together because the branch already carried the Phase 1 WIP:

Phase 1 — budget contract (preserved WIP, commit eabb537)

  • RuntimeLimits.total_memory_bytes server ceiling (default 64 MiB) + optional lower per-world WorldExecutionProfile.total_memory_bytes, validated and resolved (lower-only) in world_limits.rs; --world-total-memory-mib CLI flag.
  • Journal version 4 gating: a persisted profile/checkpoint budget bumps the header so older binaries refuse it instead of silently ignoring the budget (Define rollback compatibility for world profile journal entries #227 contract).

Phase 2 — ledger + restore enforcement (commit 2b22aac)

  • WorldMemoryBudget ledger in id-core: deterministic logical charges, atomic refusal via the typed WorldMemoryBudgetRefusal (distinct from a guest trap / open-world ceiling / storage failure), release + retry, high-water and refusal counts. Exact-boundary, refusal-atomicity, release/retry, and overflow unit tests.
  • WorldCore::restore charges the fixed core charge plus every materialized journal entry (serialized length + structural allowance) against the last persisted profile budget (or the 64 MiB default) before applying any entry. An over-budget journal refuses open whole; restore never modifies the durable journal, so the same journal reopens once the budget allows it. Restore refusal/retry + accounting tests in world/tests.rs.

Deliberately out of scope (named #557 remainder)

  • Runtime growth charge sites, program (Wasm/native) reservations, per-world session charges, transient journal/compaction peak reservations, program-ceiling clamping beneath the budget (design Phase 3/4), stats surfacing, and the 1,000-idle / 100-active measurement (the separate measurement packet, enqueued after this lands). id(world): F12.12 many worlds per node: 1,000 idle / 100 active with a per-world memory budget #557 stays open.

Tests

CI runs the id suites. New tests: ledger boundary/refusal/release/overflow in world_limits.rs; restore charging, typed refusal, and retry-after-raise in world/tests.rs; Phase 1 resolution/CLI/journal-version tests from the WIP commit.

Refs #557 (does not close it).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
dezren39 added 3 commits November 2, 2026 16:23
@dezren39
wip(id): #557 phase-1 per-world memory budget contract + journal acco…
eabb537
…unting seam (task 4827, preserved from prior lane)
@dezren39
Merge remote-tracking branch 'origin/main' into queue/4827-557-world-…
87c52ec
…memory-budget
@dezren39
id(world): enforce the per-world total memory budget at restore (#557 …
2b22aac
…phase 2, task 4827)

WorldMemoryBudget ledger in id-core (typed WorldMemoryBudgetRefusal,
atomic refusal, release/retry, high-water + refusal counts) and
WorldCore::restore charges the fixed core charge plus every
materialized journal entry (serialized length + structural
allowance) against the last persisted profile budget (or the 64 MiB
default) before applying any entry. An over-budget journal refuses
open whole; the durable journal is untouched and reopens once the
budget allows. Runtime growth, program reservations, session
charges, and transient peaks remain the named #557 remainder.
@dezren39
dezren39 requested a review from a team as a code owner November 2, 2026 22:35
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7c330094-66d8-4926-8776-1c96a69cdb59
Commits

Reviewing files that changed from the base of the PR and between 0400795 and b3ade6a.

Files selected for processing: 7
  • pkgs/id/crates/id-core/src/world_limits.rs
  • pkgs/id/src/cli.rs
  • pkgs/id/src/commands/world.rs
  • pkgs/id/src/world/core.rs
  • pkgs/id/src/world/mod.rs
  • pkgs/id/src/world/tests.rs
  • pkgs/id/src/world_store.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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-11-03T00:03:01.862669Z b3ade6a New commits
ℹ️ 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 2, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b22aac6a3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/id/src/world/core.rs Outdated
Comment on lines +230 to +233
let mut limit = crate::world_limits::DEFAULT_WORLD_TOTAL_MEMORY_BYTES;
for entry in &entries {
let persisted = match entry {
JournalEntry::ExecutionProfile { profile } => profile.total_memory_bytes,

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 2, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P1 Badge Enforce the current server ceiling during restore

When the server uses a nondefault --world-total-memory-mib, restore still enforces either 64 MiB or the raw persisted request. world_store::open_world receives the configured RuntimeLimits but calls this method without them; moreover, WorldService::set_execution_profile explicitly persists the unclamped request, contrary to the assumption above this block. Consequently, lowering the server ceiling does not constrain restore, while raising it cannot reopen a budgetless journal exceeding 64 MiB. Pass the current runtime ceiling into restore and resolve the persisted profile against it before charging.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/id/src/world/core.rs Outdated
Comment on lines +241 to +243
if let Some(total) = persisted {
limit = total;
}

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 2, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Honor budget resets in subsequent execution profiles

If a journal contains a profile with total_memory_bytes: Some(...) followed by a replacement profile with total_memory_bytes: None, this scan retains the earlier budget. However, replay replaces the entire execution profile, and None means inherit the server ceiling. Clearing a previously low budget can therefore still refuse the next reopen; clearing a high budget leaves the stale allowance enforced instead. Track the final profile, including an unset budget, rather than the last nonempty budget value.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Nov 2, 2026
id(world): F12.12 many worlds per node: 1,000 idle / 100 active with a per-world memory budget #557
Open
id(world): restore's checkpoint consecutiveness check uses plain + 1 — a penultimate u64::MAX sequence panics in debug/test builds and wraps to an accepted MAX → 0 step in release #3736
Closed
dezren39 added 2 commits November 2, 2026 17:56
@dezren39
id(world): resolve persisted budget against current server ceiling at…
4b48f98
… restore (#557, task 4827)

Codex P1 (PR #4628): open_world now passes its configured RuntimeLimits
into the new WorldCore::restore_with_runtime; restore resolves the
persisted profile against the current ceiling before charging, instead
of trusting the journaled (unclamped) request or the 64MiB default.
Codex P2: the restore scan tracks the FINAL profile, including an
unset budget — replay replaces the whole profile, so a later
total_memory_bytes: None resets an earlier budget to inherit the
current ceiling.

Also fixes three pre-existing compile errors on this branch: explicit
WorldExecutionProfile initializers missing the total_memory_bytes
field added in Phase 1 (two sandbox-gated id-core tests, one in
commands/world.rs).

Tests: cargo test --lib restore_ (17+4 pass, incl. two new regression
tests), world_limits (19 pass), world_store (30 pass) on the laptop.
@dezren39
Merge remote-tracking branch 'origin/main' into queue/4827-557-world-…
b3ade6a
…memory-budget

# Conflicts:
#	pkgs/id/src/world/core.rs
@dezren39

dezren39 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Codex findings disposition (task 4827, lane code-k) — Both Codex findings on head 2b22aac6a are FIXED in 4b48f9877 (thread replies returned GitHub 422 abuse errors, so disposition is recorded here and in the commit message). P1: open_world passes its configured RuntimeLimits into the new WorldCore::restore_with_runtime; restore resolves the persisted profile against the CURRENT ceiling before charging; regression test restore_resolves_the_persisted_budget_against_the_current_server_ceiling. P2: the restore scan tracks the FINAL profile-bearing entry including an unset (None) budget reset; regression test restore_tracks_the_final_profile_including_a_budget_reset. Also fixed three pre-existing branch compile errors (initializers missing total_memory_bytes). Verified on laptop after merging main (b3ade6a91): restore_ 19+4, world_limits 19, world_store 30 — all pass.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot assigned dezren39 Nov 3, 2026
@dezren39
dezren39 merged commit e225912 into main Nov 3, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the queue/4827-557-world-memory-budget branch November 3, 2026 00:32
@dezren39 dezren39 mentioned this pull request Nov 8, 2026
id(world): many_worlds p99 latency 5,650.792 ms vs 50 ms target — profile and reduce (#557 remainder) #7064
Closed
4 tasks
@dezren39 dezren39 mentioned this pull request Nov 22, 2026
docs(id): Phase 12 exit audit re-run and reconciliation (#12231) #12598
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dezren39 dezren39

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.