Repository navigation
Description
Evidence
On fresh origin/main (8b4cc5f5aa8e90f0bfc3f9267945c1226e29ab06), pkgs/id/src/web/world_ws.rs:106-114 computes records_revision by serializing the complete Records map into a new Vec<u8> and hashing it. host_view_handler calls world.records() and recomputes this revision on every request, before filtering records by the after cursor (world_ws.rs:153-167). The host-view client fetches these pages sequentially.
The data is bounded, but not to a page: pkgs/id/crates/id-worlds/src/world/mod.rs:2150-2190 permits 4,096 records with values up to 8 KiB each, while pkgs/id/crates/id-caps/src/world_caps.rs:740-744 caps each served page at 768 KiB. A valid near-limit records set can therefore be roughly 33 MiB. Paging such a set can serialize and hash that entire map dozens of times, allocating a full-size temporary buffer each time; per-page slicing also serializes values again. This makes a legitimate large host view disproportionately expensive in CPU and transient memory.
The existing page-count/advance fix tracked by #9043 and PR #9051 addresses a client loop, not the repeated full-map work in the server handler.
Why it matters
A world owner opening a large host view can trigger repeated full-map serialization for each bounded page. This can make the admin view slow and create avoidable memory pressure in the serving process, even though each response is capped.
Acceptance criteria
- Preserve cross-page snapshot/revision consistency without serializing and allocating the entire records map anew for every page.
- Keep the 768 KiB page limit and existing behavior when records change during paging.
- Add a regression test for a multi-page records set that pins bounded revision work (use a structural/counting oracle rather than a timing threshold) and verifies page consistency/change detection.
Activity
developing-today commentedon Nov 13, 2026
CODE-2806
dezren39 commentedon Nov 13, 2026
🤖 Agent note · triaged
host_view_handlerinpkgs/id/src/web/world_ws.rsreserializes and hashes the entireRecordsmap on every page request to computerecords_revision, so paging a near-limit records set repeats full-map CPU and allocation work dozens of times.pkgs/id/src/web/world_ws.rs, replace the per-request full-map serialize+hash forrecords_revision(lines 106-114, recomputed at 153-167) with a revision computed once per records change (cached/incremental revision maintained whereRecordsmutates), preserving cross-page snapshot/revision consistency and change detection during paging. Note fix(id-web): host-view record paging has no page bound or advance check — a repeating next_after loops the browser forever #9043 / PR fix(id-web): bound host-view record paging with an advance check #9051 fix a distinct client page-count loop, not this server work.dezren39 commentedon Nov 13, 2026
agent-note:v1
state: picked-up
task: 15343
issue: #9104
pr: null
Lane code-c picked up task 15343 in this shift. Fresh revalidation: issue #9104 OPEN, no hard-stop labels, no competing PR. Plan: in pkgs/id/src/web/world_ws.rs, replace the per-request full-map serialize+hash records_revision with a revision computed once per records change (cached/incremental, maintained where Records mutates), preserving cross-page snapshot/revision consistency, the 768 KiB page limit, and change-during-paging behavior; add a regression test with a structural/counting oracle pinning bounded revision work over a multi-page records set.
4 remaining items
dezren39 commentedon Nov 13, 2026
🤖 Agent note · picked up / verified — merging PR #9152
direct; resumed from checkpoint stageimplementation_complete(branchqueue/15343-9104-hostview-revision, PR fix(id): memoize host-view records revision per snapshot (#9104) #9152) and re-verified fresh.pkgs/id/src/web/world_ws.rs(+134/-8) — the FNV-1a hash is kept verbatim ashash_records_revision(revision values unchanged), memoized in a bounded (8-entry)RecordsRevisionCachekeyed by the published snapshot'sArc<Records>;world.records()returns(u64, Arc<Records>), so the call site type-matches the premise that publish swaps the Arc only on change. Regression tests use the counting oracle the packet required (exactly 1 hash across 5 pages of a ~1.6 MiB multi-page set, exactly 1 more after a change, cache bounded).cargo check -p id --lib— pass. In-treeweb-feature tests still cannot run because the web facade does not compile on clean main — pre-existing, filed as issue fix(id): web facade (feature web) does not compile against id-worlds since the crate split #9151; the PR's tests are in-tree and will run when fix(id): web facade (feature web) does not compile against id-worlds since the crate split #9151 lands, and the cache logic was standalone-verified by the implementing lane. PR CI: 12 checks pending in the fleet Actions stall, 0 failures; merging under the standing merge authority (verified done; CI runs on main).Merge pull request #9152 from developing-today/queue/15343-9104-hostv…