Repository navigation
bench: a DEEP navigation-stack stress oscillator - #176
Merged
Merged
Conversation
Adds a third stress bench, DeepBench (/tmp/plxnative-deepbench[=<depth>[,<ratingKey>]], default depth 100), alongside PushBench/ModalBench. Unlike those two round-tripping oscillators, DeepBench pushes `depth` pages with no pop in between (rotating Detail/Person only — see below), then pops all the way back to the root one page at a time, so the harness can grade whether transition cost or memory holds flat as the real nav stack goes ninety-plus entries deep, not just the shallow depth-1<->2 churn PushBench measures. Each push/pop is one Start/Settle pair, reusing BenchClock/bench_advance unchanged with n = 2*depth; a new pure helper `deep_step` derives direction and stack depth from the cycle index. Nav-stack finding (as directed, driven through honestly rather than guessed at): reading ui/containers/stack.rs shows NavStack's logical entry list is unbounded (depth() has no cap) — only the MOUNTED body count is capped at CAP=16 via NavStack::evict(), which unmounts (tears down Screen, delivers Unmount) the oldest live body below the top while retaining its Entry (id/arg/ReturnState), so a Pop past CAP remounts from that retained state rather than hitting a wall. Separately, NavOp::SelectTab (what Library's only production entry point, nav_tab -> nav_peer, uses) retires every entry above the root and mints at most one new entry over it — a peer swap, not a push. That makes Library unsafe for a monotonic push rotation (unlike PushBench, which is free to use it because it round-trips to depth 1 every cycle regardless), so DeepBench's push rotation is Detail/ Person only, with Person falling back to re-pushing Detail (not Library) when no cast data has landed yet. Both findings are logged at runtime and documented in bench.rs. Grading: tests/run.py gains parse_deep_bench/grade_deep_bench (dispatched by scene["bench"] == "deep") alongside the existing grade_bench — FAIL unless all 2*depth steps and the done line land; per-step worst_ms <= bench_worst_ms; push and pop drift (first-10 vs last-10) <= bench_drift_ms; a new bench_depth_rss_kb gate (default 16384) on RSS growth from step 10 to max depth; bench_rss_growth_kb on RSS growth from step 10 to the final root RSS. New tests/manifest.json scene deep-100 (tier ui, bench: deep) carries first-guess ceilings pending a device baseline, same as push-100/modal-100 did. Tests: 5 new bench.rs unit tests (fake-clock: step count, push/pop trajectory, rotation, Library exclusion, no-ratingKey zero-cycles run) plus 10 new test_harness.py tests (parser, a healthy pass, and each fail condition: missing steps, missing done line, a slow step, push drift, pop drift, depth-RSS growth, root-RSS growth, plus a manifest shape check). docs/agent-reference.md's STRESS family sentence and trigger list gain deepbench/ bench_depth_rss_kb. Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a third stress bench,
DeepBench, alongside the existingPushBench/ModalBenchcounted stress oscillators. Unlike those two, which round-trip between depth 1 and 2 every
cycle,
DeepBenchpushesdepthpages (default 100, triggerplxnative-deepbench[=<depth>[,<ratingKey>]]) with no pop in between, then pops all theway back to the root one page at a time —
2*depthsteps total — so the harness can gradewhether transition cost or memory holds flat as the real nav stack goes ninety-plus entries
deep, not just the shallow churn
PushBenchmeasures.rust-modules/src/dev/scenarios/bench.rs:DeepDir,deep_step(pure helper derivingdirection and stack depth from the cycle index),
DeepBench, 5 unit tests.rust-modules/src/dev/scenarios.rs: the trigger, tick/open/close wiring.rust-modules/src/app/{boot,run}.rs: wiring into the app.tests/run.py:parse_deep_bench/grade_deep_bench, dispatched whenscene["bench"] == "deep".tests/manifest.json: thedeep-100scene.tests/test_harness.py: 10 new tests (parser, a healthy pass, and each fail condition).docs/agent-reference.md: the stress-family sentence and trigger list gain DeepBench.Why Library is excluded from the push rotation
DeepBench's push rotation is Detail/Person only — Library is deliberately never pushed.Reading
ui/containers/stack.rsshowsNavStack's logical entry list is unbounded (only themounted body count is capped, via
NavStack::evict()), butNavOp::SelectTab— Library'sonly production entry point (
nav_tab -> nav_peer) — retires every entry above the root andmints at most one new entry over it: a peer swap, not a push. A monotonic push rotation
through Library would therefore collapse the very depth this bench exists to build. That
reasoning (and the fallback: Person re-pushes Detail, never Library, when no cast data has
landed yet) is documented in
bench.rs's module doc and comments.Device baseline (already measured on the TV, at main's build)
The
deep-100scene ran 200/200 steps: 180 steps over 20 ms, p50 28.3 ms, p95 41.5 ms, max88.8 ms (the cold first Detail open). Frame cost does not grow with depth — 23/24/23/22
steps over budget per depth band on push, 22/21/23/21 on pop — and crossing the
16-mounted-body eviction boundary shows no step change. Memory falls while deep, then ends
11.9 MB above the depth-10 baseline after a full unwind. A later run on a separate
performance-investigation branch measured 120/200 steps over budget and 33.7 MB of root
growth on a different build.
The scene's ceilings in
tests/manifest.jsonare first guesses and currently fail againstthat baseline. That is deliberate, the same way
push-100/modal-100shipped withfirst-guess ceilings before their own device baselines existed: the ceilings describe the
target the bench holds the app to, and the failures are tracked as follow-up work, not as a
reason to loosen the gate.
Gates run (all green, on the committed tree, in this order)
cargo +nightly test --manifest-path rust-modules/Cargo.toml --lib— 3884 passed, 0failed, 1 ignored (includes the 5 new
bench.rsunit tests).python3 -m unittest test_harnessfromtests/— 333 passed, OK (one pre-existingquarantined flow unrelated to this change:
12-filmography-detail-return, quarantined foran unrelated encoder limitation).
CARGO_INCREMENTAL=0 cargo +nightly check --manifest-path rust-modules/Cargo.toml --lib --no-default-features— clean.make check— host suite + lint gate, clean.make— the ARM cross-build, clean.Rebased onto
origin/main(b2559855) cleanly; no conflicts intests/run.pyortests/test_harness.pydespite the recent test-file-split work there.A
doc-claim-auditorpass against the diff found zero contradictions in project prose.🤖 Generated with Claude Code