Skip to content

Scaling A3 · Naming a place in an act does not build every walk offer or the whole menu #2528

Open

Description

@genekogan

Tranche: #2504 · Agenda: #1960 · Lane: A · An act costs less of the clock · Task: A3 · Ceiling: 3 h (a limit, not a target) · Tier: expected T3; node tools/proof/tier.mjs decides · Depends on: #2527 (A2) merged or handed back

Why this tranche exists (keep it in view): The system must scale smoothly across Souls, agents and viewers, each without starving the others and without limiting anyone's experience, far enough to be confident on a front-page day or at a live event with hundreds of active agents. This task is one step toward that. If it stops serving that, hand back. Overview: docs/architecture/scaling.md; spec: #2504.

Main purpose

Cut "the rest of the handler" (23 to 47 ms per act at 50 agents) by not building offers nobody asked for.

Problem

In explicitPlaceCapability (apps/server/src/edge/boot/world-places.ts): an act whose id is not among the Soul's listed offers runs offeredWalkObject → bindFocus({verbs:['walk']}), which builds every walk offer; strictCheck(…, caps()) evaluates caps() eagerly, which is the whole menu, for a target that is not a known place; and knownBootPlaces is rebuilt two or three times per act. Place resolution was 674 to 750 ms of the 1,530 ms "rest of handler" group at 24 agents (#2470).

Outcome

The common cases cost a lookup; the whole menu is built only on the refusal path that needs it.

Step 0: check the premise

From M2's profile at 50 agents: milliseconds per act under explicitPlaceCapability. Expected 10 to 25. Hand back if under 5.

Design (given)

In order, stopping when the acceptance is met:

  1. Make caps lazy in strictCheck (a function called only when a refusal needs the "did you mean" list).
  2. Memoise knownBootPlaces per Soul and tick.
  3. For a not-offered walk id, resolve through the places index (places.ts forRef) and bind that one id; keep the object-walk labels that the place.ambiguous refusal needs, building them only when two candidates match.

Alternatives you may choose

  • Stop after steps 1 and 2 if they meet the bar: they change no result by construction.

Risks and footguns

  • Step 3 can silently drop the place.ambiguous refusal. The oracle must include ambiguous words.
  • The corpus: use the place words of the existing world-places and nav-focus-oracle tests; if none covers refusals, build it from Eden 2026's named things as nav-focus-oracle.test.ts does, and say so.

Acceptance

  • A1 Oracle test: over the corpus (offered ids, not-offered known places, unknown words, ambiguous words) the capability or the refusal, including its code and "did you mean" list, equals the old path's.
  • A2 Milliseconds per act under explicitPlaceCapability at 50 agents fall by at least 60 % (M2's profile).
  • A3 eval-scripted --battery m4-v1: same receipts and state hashes.
  • A4 eval-load --souls 24,50 --act-sec 10 --profile, base against candidate, 2 repeats.

Measure

Expected: rest of handler at or under 12 ms per act at 50 agents (23 to 47 today). It does not change bind or route search.

Not in this task

god/nav.ts (#2489 owns it). The bind itself.

Touches

apps/server/src/edge/boot/world-places.ts, apps/server/src/edge/intents/strict.ts, apps/server/src/edge/ledger/ledger.ts (call sites only), tests, changes/.

Proof

T3 by path. The oracle and the runs.

Latitude and hand-back (tranche rule, the maintainer, 16 Nov)

  • The main purpose above is the task. At every hour of work, and before any sub-step longer than 20 minutes, write one line in your notes: what you are doing and how it serves the main purpose. If you cannot say, stop that sub-step.
  • Step 0 first, where the task has one. If the premise's number does not reproduce within a factor of two, hand back.
  • You may change how: names, data shapes, test structure, an internal step, one of the listed alternatives, or your own equivalent, when the code as found shows it is better. Record it in the pull request under "Deviations from the design" with the evidence. Add your own analysis where it helps.
  • You may not change what: the purpose, the acceptance bars, Touches or the ceiling. Never tune toward the expected effect; a result far from it is a finding.
  • Even and uneven. Where this task compares runs, run the even arm it names and one uneven arm (the event shape of the shapes task, once merged; for viewers, arrivals in a wave with viewers who leave), and report both. Real load is skewed, spiky and shifting; a gain that shows only under even load is reported as that.
  • A smaller gain is still a result. If the measured improvement is real (outside the noise of two repeats) but below a bar, mark that box unmet: with the numbers and finish the pull request. The coordinator weighs the gain against the complexity added and decides whether it merges (the maintainer, 16 Nov: any tangible improvement counts unless its complexity outweighs it).
  • Hand back at once (comment here, push what exists, end the session) when: Step 0 fails; the design does not fit the code and no alternative does; the expected effect will clearly not appear; you pass one and a half times your own estimate with acceptance not in sight; or you find the purpose itself is wrong. Say what you found, what you tried, the numbers, and one proposed rescope. A hand-back is a complete and valid outcome.

Stop rule

Say when you started in your first comment here, and state the time you took in the pull request. The ceiling is wall-clock time from your start, not counting waits on CI or review. Do exactly what the acceptance asks and nothing beside it: no extra cases, options, refactors or tests because there is time left. Stop when any of these happens: every acceptance box is ticked, marked unmet: or marked deferred:, and the pull request is ready; the ceiling is reached; the change needs more than a mechanical edit of ten lines in a file outside Touches (an "Also fixed" fix in the same area may take up to about 50), or a criterion not listed here; a declared run fails twice. Then push, comment here with what is done and the exact next step, and end the session. List every file you edited outside Touches in the pull request under "Outside Touches". Do not take another issue or re-declare a run. A defect you find on the way is fixed in this pull request and listed under "Also fixed" when the fix is small (about 30 minutes or 50 lines), stays in the same area and does not raise the tier; otherwise it gets its own small pull request, with no issue: its description is the record. File an issue only for work that will not start today, needs Gene's decision or is larger than about 2 hours. Only the coordinator changes Acceptance, Touches or the ceiling, by editing this issue.

Activity

  1. added this to the Scaling tranche milestone on Nov 16, 2026
  2. self-assigned this
    on Nov 16, 2026
  3. added
    agent:claimedAn agent or person has claimed this issue; others leave it alone
    on Nov 16, 2026
  4. genekogan commented on Nov 16, 2026

    @genekogan
    MemberAuthor

    Lane started 2026-11-16 09:06 UTC. Base: origin/agent/2527-walk-bind-once (A2, PR 2582, not yet merged); the PR will retarget main once A2 merges. Step 0 first.

  5. genekogan commented on Nov 16, 2026

    @genekogan
    MemberAuthor

    Bars, declared before the runs (lane, 2026-11-16). Not re-scored after.

    Runs. All on souls-timed via timed-run.yml, 2 repeats, base dispatched first and candidate straight after.

    • Base: agent/2528-meter-base. That is A2's head (PR 2582, not merged yet) plus one tooling commit. The commit adds a row to the act meter: for an act's samples (act.*), the inclusive clock ms per act under explicitPlaceCapability and its parts (offeredWalkObject, knownBootPlaces, strictCheck, resolvePlaceForVerb, resolveBootPlace). M2's profile has no per-function row, and A2 needs one.
    • Candidate: agent/2528-place-lookup-lazy, which is the base plus the change.
    • eval-load: --souls 24,50 --act-sec 10 --duration-sec 120 --profile --menu-stats.
    • eval-scripted: --battery m4-v1 --seat scripted.

    Step 0 (premise). From the base run, the ms per act under explicitPlaceCapability at 50 Souls, mean of the 2 repeats. If it is under 5, the premise fails and I hand back. Local, one Eden 2026 boot, a far place asked by id with the gate's bind before it: 20.9 ms per call. Of that, 13.1 ms is walkOnDemand's route search, which this task leaves alone ("the bind itself").

    A1. node --test apps/server/src/edge/boot/world-places-oracle.test.ts.

    • Eden 2026, at arrival and after one walk.
    • The corpus: every offered walk id; other place verbs that are offered; known places by id that are not offered, for walk and every other place verb; place names and aliases; things' walk labels with and without "the"; unknown ids and words; and ambiguous words. The ambiguous words are names two places share, things whose walk label is also a place's name or alias, and labels two things share, each tried as walk, stroll and "walk:the …".
    • The new answer must equal the old path's, frozen in the test, as whole JSON: ok, code, reason, did_you_mean, chosen and next. Pass means 0 differences.
    • The existing world-places tests do not cover refusals, so the corpus is built from Eden 2026 as nav-focus-oracle.test.ts does.

    A2. The act meter's "under explicitPlaceCapability" row, ms per act at 50 Souls, mean of 2 repeats.

    • Met when the candidate's mean is at most 40 % of the base's (a drop of 60 % or more) and the repeats do not overlap.
    • If the drop is real (no overlap) but under 60 %, it is marked unmet: with the numbers.
    • Local expectation, said now: about 30 %. What remains is walkOnDemand's route search.

    A3. eval-scripted m4-v1, base against candidate. For each item, result.json must match: succeeded, why, endedBy, card outcome. Receipts named by the items must be the same receipt and phase. As in A2's lane, I read "state hashes" as each item's scored end state, because the eval prints no hash. Ids minted per run are not compared, and neither are admission retries (world.busy, soul.busy).

    A4. The eval-load runs above, reported with no score of their own:

    • the world's rest-of-handler part and the profile's act.handler-other, in ms per act;
    • builds per act;
    • achieved against intended acts.

    Act latency is not scored. Every act queues about 19.5 s at the world (the admission state V0 is fixing in PR 2583, not merged), so I use the act meter's own parts instead.

    Uneven arm. Not run. eval-load has no shape option yet (#2556's shapes cover the bench and meetup), so only the even arm runs, as in A2.

  6. genekogan commented on Nov 16, 2026

    @genekogan
    MemberAuthor

    Lane checkpoint: waiting on runners (2026-11-16 09:40 UTC). Draft PR #2587 is at head 3cc2746, against agent/2527-walk-bind-once. Retarget it to main once PR 2582 merges.

    Done:

    • A1 is met. The oracle test passes with 0 differences: about 2,200 cases on Eden 2026, at arrival and after one walk. It includes ambiguous words and cold menus, and it asserts that place.ambiguous and capability.unknown are among the answers.
    • Reviewer pass: no correctness defect found. Its notes are applied.
    • Local finding: on a far place asked by id, explicitPlaceCapability went from 20.9 to 14.5 ms per call (−30 %). What remains is walkOnDemand's route search, 13.1 ms, which is the bind and out of scope. So the A2 bar of 60 % is expected to be unmet:, as I said in the bars comment before the runs.

    Runs dispatched (all from the workflow at agent/2528-meter-base):

    • eval-load, base agent/2528-meter-base: 43840052046
    • eval-load, candidate agent/2528-place-lookup-lazy: 43840059183
    • eval-scripted m4-v1, base: 43840064051
    • eval-scripted m4-v1, candidate: 43840067966
    • clip doors-everywhere, candidate: 43840108997

    Exact next step: when the runs finish, score them by the bars comment:

    1. gh run download <id> -R soulsimulation/souls for each run.
    2. Step 0 and A2: in each eval-load/LOAD.md, read the "Under (Scaling A3 · Naming a place in an act does not build every walk offer or the whole menu #2528 …)" line, explicitPlaceCapability ms per act at 50 Souls. Take the mean of r1 and r2, base against candidate. Met at ≤ 40 % of base with no overlap between repeats; otherwise unmet: with the numbers. If the base mean is under 5, Step 0 fails: hand back.
    3. A4: report rest of handler, act.handler-other, builds per act, and achieved against intended acts.
    4. A3: compare result.json per item (succeeded, why, endedBy, card outcome, named receipts).
    5. Clip: upload it, with proof.json, through tools/proof/upload.mjs.
    6. Fill the PR, then run node tools/proof/acceptance.mjs check. It is T3, so no merge:ready.
  7. genekogan commented on Nov 16, 2026

    @genekogan
    MemberAuthor

    Scored per the bars (2026-11-16 10:15 UTC). PR #2587 is ready, at head 3cc2746, T3, labelled ci:run. Its base is still agent/2527-walk-bind-once, because PR 2582 has not merged. Proof: https://assets.eden.art/proofs/pr-2587/proof-2.json

    • Step 0: holds. Base, under explicitPlaceCapability at 50 Souls: 32.7 and 40.5 ms per act (mean 36.6).
    • A1: met. The oracle shows 0 differences.
    • A2: unmet, no measurable gain.
      • Candidate: 66.0 and 34.2 ms per act (mean 50.1). That is +37 %, and the repeats overlap.
      • Finding. Under load, the cost is offeredWalkObject building every walk offer: 23.6 and 36.0 ms of the base's 32.7 and 40.5.
      • I set aside the design's step 3 on a single-Soul local profile. There, that build was a kept focus and close to free. Under load it is not.
    • A3: met. 12/12 items are the same. Whatson's calendar id is minted per run and was set aside, as declared. Both runs name the same receipts.
    • A4: reported. At 50 Souls:
      • rest of handler: 75.2 and 82.3 ms per act on base, 97.5 and 75.1 on the candidate;
      • builds per act: 1.32 and 1.27 on base, 1.26 and 1.18 on the candidate;
      • achieved: 18 % of intended on both;
      • queue: about 19.5 s per act on every arm.
    • Clip: doors-everywhere, a walk by place id, behaves as before.

    Proposed rescope. A follow-up for the design's step 3 as written: do not build every walk offer for a walk id that is not offered.

    • Today offeredWalkObject builds that walk focus only to compare object labels against the asked words.
    • An id-shaped target that is a known place's id can skip it only if no offered object walk carries that exact label. Proving that needs a label index, or a narrower focus, from the nav listing. god/nav.ts is Cheaper acts: the nav things list is updated per commit, not rebuilt after every edit #2489's.
    • The A2 bar needs this. This PR's changes alone do not move it.
  8. genekogan commented on Nov 16, 2026

    @genekogan
    MemberAuthor

    Follow-up lane (design step 3: skip building every walk offer for an asked walk id that is not offered) started 2026-11-16 10:11 UTC. Branch agent/2528-skip-unoffered-walks from agent/2528-place-lookup-lazy (keeps #2587's oracle and meter row). Ceiling 2 h.

  9. genekogan commented on Nov 16, 2026

    @genekogan
    MemberAuthor

    Bars for the step 3 follow-up (declared 2026-11-16, before any run; not re-scored after). Branch agent/2528-skip-unoffered-walks at 82c6766.

    Measurement branches (each a normal merge of the two V0 fixes, which have not merged: PR #2583 at 5c23cdf and PR #2586 at 3a00bd8; never on the PR branch):

    • base agent/2528-skip-m-base (bcbac14) = agent/2528-meter-base (eb00055: A2's head plus the meter row) + both fixes;
    • candidate agent/2528-skip-m-cand (b3b1534) = the PR branch + both fixes.

    Runs, on souls-timed via timed-run.yml, base then candidate dispatched back to back:

    • eval-load --souls 24,50 --act-sec 10 --duration-sec 120 --profile --menu-stats, repeats 2, each arm;
    • eval-scripted --battery m4-v1 --seat scripted, repeats 1, each arm.

    Uneven arm: eval-load has no shape flag on timed-run's allowlist yet (#2556's shapes are not wired into it), so this is the even arm only, said as such.

    • A1 (oracle): node --test apps/server/src/edge/boot/world-places-oracle.test.ts, 0 differences, including asked ids that are a known place's id and a thing walk's label (offered now and not offered now).
    • A2 (met when both hold): from LOAD.md's "Under" row, explicitPlaceCapability clock ms per act at 50 Souls:
      • candidate mean <= 50 % of base mean;
      • no overlap: the candidate's larger repeat is below the base's smaller repeat.
        Reported, not gated: the same at 24 Souls, the parts under it (offeredWalkObject, resolvePlaceForVerb, resolveBootPlace, knownBootPlaces), rest of handler, builds per act, achieved and queue per act, host load and cores per process.
    • A3: every m4-v1 item has the same verdict (succeeded, why, endedBy, card outcome) and the receipt-scored items name the same receipts and phases on both arms. Set aside as before: ids minted per run (whatson's calendar id) and admission retries that write no receipt.
  10. genekogan commented on Nov 16, 2026

    @genekogan
    MemberAuthor

    Step 3 follow-up scored per the bars (comment 6913809327), 2026-11-16. PR #2591 is ready at 82c6766 (T3, no merge:ready). Proof: https://assets.eden.art/proofs/pr-2591/proof.json

    • A1: met. The oracle shows 0 differences, including asked ids that are a known place's id and a thing walk's label, offered now (117, 105) and not offered now (40).
    • A2: unmet, no gain. explicitPlaceCapability at 50 Souls: base 47.9 and 34.3 ms per act (mean 41.1); candidate 52.7 and 74.3 (mean 63.5). That is +55 %, and the repeats overlap.
      • offeredWalkObject at 50 Souls: base 25.1 and 20.8; candidate 28.6 and 33.8.
      • At 24 Souls (reported only), explicitPlaceCapability went from 24.8 and 23.7 to 22.7 and 19.4, and offeredWalkObject from 13.9 and 11.5 to 9.3 and 6.2.
      • Finding. Building no other walk's standing point or route check (walkKeep) leaves offeredWalkObject's cost at 50 Souls. What remains is the fixed part of any focused walk build: the native capability read and the nav ranking of every thing. Cutting it needs offeredWalkObject to read no walk build at all (for example, a label index of thing walks kept with the nav listing), which this design does not do.
      • Every arm queued about 19.4 s per act (p50) with both V0 fixes merged in, and achieved 19 to 27 % of intended acts at 50 Souls. Candidate repeat 2 answered only 71 acts and entered red once.
    • A3: met. m4-v1 has 12/12 episodes the same (succeeded, why, endedBy, card). The same receipts on both arms: eat:eat.e_2accdf4c started, play-music:play-music.e_18fdb81d started. The only differences are admission retries.

    Runs: eval-load base 43848768342 and candidate 43848772778; m4-v1 base 43848777197 and candidate 43848782001. Even arm only.

  11. genekogan commented on Nov 16, 2026

    @genekogan
    MemberAuthor

    Coordinator: A3 closed without a merge. PRs 2587 and 2591 are oracle-proven but give no gain under load. The cost sits in the fixed focused walk build (decision on PR 2591). The issue stays open until M4's profile decides whether a label-index design is worth a task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent:claimedAn agent or person has claimed this issue; others leave it aloneepic:scalabilityServer scalability / reliability epictype:taskCurrent task

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions