Skip to content

tools(eval): nav.audit split into nav.warm/tile/label; tasks of 100 ms or more attributed to a cause (#2592 follow-up) - #2604

Merged
genekogan merged 1 commit into
mainfrom
agent/2592-prof-attribution
Nov 16, 2026
Merged

genekogan merged 1 commit into
mainfrom
agent/2592-prof-attribution

Conversation

@genekogan

Copy link
Copy Markdown
Member

Problem

The profiler's grouping misled two lane A investigations (A9 and A11, issues 2592 and 2601). Its nav.audit group mixed three things: the budgeted connectivity audit, fine tiles built on demand, and labels built on demand. Its "rest of the tick" (tick) group was not attributed at all. This dispatched follow-up has no issue of its own: the coordinator's brief sets its bounds, and this PR is the record.

Acceptance

  • A1 A unit test with a synthetic profile: tasks land in the right new groups, and attribution picks the expected function — evidence: node --test tools/playtest/eval/prof-buckets.test.mjs -> 5 pass, 0 fail. The new test checks five things. A tile built under the audit goes to nav.warm, asked by navStep. A tile from a walker's page sync goes to nav.tile, asked by enterLeg. A label-cache miss in an act's read goes to nav.label, asked by goal, with the engine's navCheckV1 wrapper skipped. A tick with one dominant path is attributed to crowd, the deepest frame holding at least 50 %. A tick with no dominant child is attributed to stepInner, the frame just under the tick. Tasks under 100 ms are left out, and navAuditMsPerSec is the sum of the three groups.
  • A2 Re-run the attribution offline on the existing artifacts (runs 43858864408 and 43863317178) and post the per-group top-10 tables on the issue — deferred: the artifacts lack the raw profile, because load.mjs deletes world.cpuprofile after bucketing it. What they do allow (the longest nav runs sorted into the new groups, and the task counts) and the exact next run are posted at Scaling A9 · The world's clock thread holds the loop for seconds, so admission stays amber and acts starve #2592 (comment). The tables come from the next profiled run with this instrument.
  • A3 The artifact lacks the raw profile, as stated, so the instrument now keeps a compact list of long tasks with frames — evidence: step0.longTasks (each task of 100 ms or more: group, cause, top 3 groups, the heaviest path's app frames) and step0.causes (top 10 per group, with counts), asserted in the new test; issue comment Scaling A9 · The world's clock thread holds the loop for seconds, so admission stays amber and acts starve #2592 (comment)

Proof

Tier: T0 (node tools/proof/tier.mjs -> T0, tools and docs only)

  • proof.json: none (T0)
  • clips: none (T0)
  • images: none (T0)

Self-audit

  • Checks run:
    • node --test tools/playtest/eval/prof-buckets.test.mjs -> 5 pass
    • node .github/scripts/guards.mjs scrub --base origin/main -> 0 problems
    • node tools/proof/publication.mjs on the issue comment and on this body -> passed
  • Failed attempts: In the first draft of the test, the no-dominant-child case used a 50/50 split. 50 % meets "at least 50 %", so the rule picked a child. The test now uses 40/30/30.
  • Long tail / externalities: Only --profile runs are affected. load-result.json gains about 0.5 KB per task of 100 ms or more (about 370 tasks at 50 agents, so roughly 200 KB). The world itself does not change. navAuditMsPerSec, and the line in load.mjs that prints it, keep their old meaning: the sum of the three groups.
  • Known limits:
    • The cause rule is my reading of the brief. For nav.* the cause is the caller (who asked), because the nav functions are leaf builders and their callee would name build internals. For the other groups it is the callee under the group's entry.
    • nav.warm includes the spatial sync that navWarmV1 starts with, as the engine documents it ("including the current spatial sync"). This keeps the old group equal to the three new ones, sample for sample.
  • Docs: docs/architecture/load.md: the profile groups and the new causes/longTasks.

Changelog

no-changelog: tools and docs only.

Risk

Low. Measurement-only code in the eval tools. Group names change for --profile reports, and the header maps old tables to new ones. Roll back by reverting this commit.

Outside Touches: docs/architecture/load.md (3 lines changed: the group list, plus a sentence on causes).
Time: started 12:23 UTC. The PR opened at 12:32 UTC, about 9 minutes of the 1.5 h ceiling.

🤖 Generated with Claude Code

…ach task of 100 ms or more gets a cause (#2592)

The profile classifier's nav.audit mixed the budgeted connectivity audit, fine tiles built on demand and labels built
on demand. They are now three groups that still sum to the old one. Each JS task of 100 ms or more is attributed to a
cause (for nav.*, the caller outside the spatial service; otherwise the frame just under the group's entry, followed
down while one child holds half the task), with the top 10 per group and a compact list of the tasks and their
heaviest paths, so later runs need no .cpuprofile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@genekogan
genekogan marked this pull request as ready for review November 16, 2026 12:31
@genekogan genekogan added no-changelog Nothing user-facing; no changes/ fragment needed ci:run Open the CI window: run this ready PR's heavy CI jobs (docs/testing.md#ci-window) labels Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Proof check: proof-ok passes

Tier T0 from docs/architecture/load.md, tools/playtest/eval/prof-buckets.mjs, tools/playtest/eval/prof-buckets.test.mjs (node tools/proof/tier.mjs).
Required at T0 (docs/process/PROOF-POLICY.yml): lint.

Check Status Detail
problem statement ok present
Acceptance criteria
Criterion Status Evidence
[x] A1 A unit test with a synthetic profile: tasks land in the right new grou met node --test tools/playtest/eval/prof-buckets.test.mjs -> 5 pass, 0 fail. The new test checks five things. A tile built
[ ] A2 Re-run the attribution offline on the existing artifacts (runs 4385886 deferred the artifacts lack the raw profile, because load.mjs deletes world.cpuprofile after bucketing it. What they do allow
[x] A3 The artifact lacks the raw profile, as stated, so the instrument now k met step0.longTasks (each task of 100 ms or more: group, cause, top 3 groups, the heaviest path's app frames) and `step0.c

Proof links: 0 video, 0 image, no proof.json.

Warnings

  • Problem does not link an issue (Closes #n)

Updated on every edit, push, label and review. How to fill it: .claude/skills/journal/SKILL.md. T3-T4 also need the maintainer's sign-off (tools/proof/gate.mjs). A maintainer can waive with the proof:waived label.

@genekogan genekogan added merge:ready Hand the PR to the merge train (.github/workflows/merge-train.yml) ci:run Open the CI window: run this ready PR's heavy CI jobs (docs/testing.md#ci-window) and removed ci:run Open the CI window: run this ready PR's heavy CI jobs (docs/testing.md#ci-window) labels Nov 16, 2026
@genekogan
genekogan enabled auto-merge November 16, 2026 12:35
@genekogan
genekogan added this pull request to the merge queue Nov 16, 2026
@genekogan genekogan added ci:run Open the CI window: run this ready PR's heavy CI jobs (docs/testing.md#ci-window) and removed ci:run Open the CI window: run this ready PR's heavy CI jobs (docs/testing.md#ci-window) labels Nov 16, 2026
Merged via the queue into main with commit 4e8d73f Nov 16, 2026
62 of 77 checks passed
@genekogan
genekogan deleted the agent/2592-prof-attribution branch November 16, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run Open the CI window: run this ready PR's heavy CI jobs (docs/testing.md#ci-window) merge:ready Hand the PR to the merge train (.github/workflows/merge-train.yml) no-changelog Nothing user-facing; no changes/ fragment needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant