editor: tree-cost timing guard intermittently exceeds 4 ms on dev-01 #1079

Open
opened 2026-11-11 14:34:11 +00:00 by kayg · 3 comments
Owner

test/tree-cost.test.ts hit its timing-only 4 ms guard on dev-01 during the rows restack qualification. Full editor suites: #878 measured 6.171 ms, #904 6.080 ms; the functional 1,000-item assertion passed.

Fresh-process targeted repeats through Nix and one normal ~/bin/slot: dev 437f9ec8923b3d380506f48a77eb11493ef66fb0 10/10 passed; #878 3a147fdf112ad5c9c205bf9276139795a2bcd041 10/10 passed; #904 cae01dd4950b02a8de57ee40caf390aae04de22e 9/10 passed, first run 4.155 ms. All timings and failures are retained. packages/editor is byte-identical between dev and #878; #904 also leaves lists/shape.ts, lists/tree-lines.ts and this test unchanged.

Command, ten fresh processes per ref: cd packages/editor && bunx vitest run test/tree-cost.test.ts.

Related #1074 covers refusal/backlog timing and has its own explicit exemption for the rows stack. This different guard is tracked separately; no exemption is assumed for the reproduced #904 failure. Preserve the functional assertion and qualify performance with same-session dev controls on the perf VMs.

`test/tree-cost.test.ts` hit its timing-only 4 ms guard on dev-01 during the rows restack qualification. Full editor suites: #878 measured 6.171 ms, #904 6.080 ms; the functional 1,000-item assertion passed. Fresh-process targeted repeats through Nix and one normal `~/bin/slot`: dev `437f9ec8923b3d380506f48a77eb11493ef66fb0` 10/10 passed; #878 `3a147fdf112ad5c9c205bf9276139795a2bcd041` 10/10 passed; #904 `cae01dd4950b02a8de57ee40caf390aae04de22e` 9/10 passed, first run 4.155 ms. All timings and failures are retained. `packages/editor` is byte-identical between dev and #878; #904 also leaves `lists/shape.ts`, `lists/tree-lines.ts` and this test unchanged. Command, ten fresh processes per ref: `cd packages/editor && bunx vitest run test/tree-cost.test.ts`. Related #1074 covers refusal/backlog timing and has its own explicit exemption for the rows stack. This different guard is tracked separately; no exemption is assumed for the reproduced #904 failure. Preserve the functional assertion and qualify performance with same-session dev controls on the perf VMs.
Author
Owner

repeat logs: https://git.kayg.org/attachments/6a34a9ed-7530-4eeb-bbf2-5a255e9d86f6

dev 10/10 pass; #878 10/10 pass; #904 9/10 pass (4.155 ms in the failing repeat). #904 remains blocked by this reproduced timing gate. this is separate from the exempt offline-backlog failure tracked in #1074.

repeat logs: https://git.kayg.org/attachments/6a34a9ed-7530-4eeb-bbf2-5a255e9d86f6 dev 10/10 pass; #878 10/10 pass; #904 9/10 pass (4.155 ms in the failing repeat). #904 remains blocked by this reproduced timing gate. this is separate from the exempt offline-backlog failure tracked in #1074.
Author
Owner

round 3 #1079 investigation and fix, commit 6205d1165 on #904.

the old test and its production dependency path are unchanged from dev: tree-cost.test.ts, lists/shape.ts, lists/tree-lines.ts, lists/branch.ts, syntax/frontmatter.ts and origins.ts; vitest setup/config and the lockfile are unchanged. the test creates a plain EditorState without the new hidden-block extension, so it cannot exercise that extension's rendering path. the editor package.json only adds its export.

this round, the unchanged dev full editor suite itself reproduced the tree guard: 4.876911 ms against 4 ms. its 1,000-item correctness assertion passed. the other failing dev test was the explicitly exempt offline backlog (#1074). this establishes a pre-existing timing flake, not a new hidden-block tree-rendering regression. the accepted perf-VM nested-list CPU comparison remains the speed gate.

fix: remove the elapsed-time loop/assertion from this shared-host correctness test; retain the 1,000-item assertion and add a trailing-continuation assertion. production/editor UI code is unchanged, so existing Safari/iPhone proof applies. paired 10 fresh-process runs each on dev and old #904, then 10 each on dev and fixed #904, plus the fixed editor suite are queued through dev-01 slots; results will be attached before qualification.

round 3 #1079 investigation and fix, commit `6205d1165` on #904. the old test and its production dependency path are unchanged from dev: tree-cost.test.ts, lists/shape.ts, lists/tree-lines.ts, lists/branch.ts, syntax/frontmatter.ts and origins.ts; vitest setup/config and the lockfile are unchanged. the test creates a plain EditorState without the new hidden-block extension, so it cannot exercise that extension's rendering path. the editor package.json only adds its export. this round, the unchanged dev full editor suite itself reproduced the tree guard: 4.876911 ms against 4 ms. its 1,000-item correctness assertion passed. the other failing dev test was the explicitly exempt offline backlog (#1074). this establishes a pre-existing timing flake, not a new hidden-block tree-rendering regression. the accepted perf-VM nested-list CPU comparison remains the speed gate. fix: remove the elapsed-time loop/assertion from this shared-host correctness test; retain the 1,000-item assertion and add a trailing-continuation assertion. production/editor UI code is unchanged, so existing Safari/iPhone proof applies. paired 10 fresh-process runs each on dev and old #904, then 10 each on dev and fixed #904, plus the fixed editor suite are queued through dev-01 slots; results will be attached before qualification.
Author
Owner

focused #1079 reproduction and fix verification:

  • original test, 10 interleaved fresh-process runs each: dev 437f9ec8923b3d380506f48a77eb11493ef66fb0 10/10 pass; old #904 cae01dd49 10/10 pass.
  • second 10-run interleaved set: unchanged dev 7/10 pass (3 timing failures); fixed #904 6205d11653c6fdb4c8b32f251b0d3be09ed8f47a 10/10 pass.
  • unchanged dev also failed the original tree timer during the full editor suite: 4.876911 ms against 4 ms. its 1,000-item correctness assertion passed.
  • the test and its tree-shaping dependency path were identical on dev and old #904. plain EditorState does not install #904's hidden-block extension. this is a pre-existing wall-clock gate flake, not evidence of a hidden-tree rendering regression.

fix 6205d1165 keeps the 1,000-item correctness check, adds the trailing-continuation shape assertion and leaves CPU measurement to the existing perf harness. no production UI source changed; accepted pooled web CPU and native screenshots remain applicable.

commands on dev-01 via ~/bin/slot and nix develop: bunx vitest run test/tree-cost.test.ts --reporter=verbose (each process repeated 10 times per arm), plus bun run test for the editor suite.

full fixed editor suite: 569 pass, 2 timing failures. one is exempt pre-existing offline backlog #1074; the other is unchanged link ranking (17.465 ms against 16 ms), now being checked against dev in 10 interleaved runs before the final gate verdict.

raw tree checks and full-suite logs

focused #1079 reproduction and fix verification: - original test, 10 interleaved fresh-process runs each: dev `437f9ec8923b3d380506f48a77eb11493ef66fb0` 10/10 pass; old #904 `cae01dd49` 10/10 pass. - second 10-run interleaved set: unchanged dev 7/10 pass (3 timing failures); fixed #904 `6205d11653c6fdb4c8b32f251b0d3be09ed8f47a` 10/10 pass. - unchanged dev also failed the original tree timer during the full editor suite: 4.876911 ms against 4 ms. its 1,000-item correctness assertion passed. - the test and its tree-shaping dependency path were identical on dev and old #904. plain EditorState does not install #904's hidden-block extension. this is a pre-existing wall-clock gate flake, not evidence of a hidden-tree rendering regression. fix `6205d1165` keeps the 1,000-item correctness check, adds the trailing-continuation shape assertion and leaves CPU measurement to the existing perf harness. no production UI source changed; accepted pooled web CPU and native screenshots remain applicable. commands on dev-01 via `~/bin/slot` and `nix develop`: `bunx vitest run test/tree-cost.test.ts --reporter=verbose` (each process repeated 10 times per arm), plus `bun run test` for the editor suite. full fixed editor suite: 569 pass, 2 timing failures. one is exempt pre-existing offline backlog #1074; the other is unchanged link ranking (17.465 ms against 16 ms), now being checked against dev in 10 interleaved runs before the final gate verdict. [raw tree checks and full-suite logs](https://git.kayg.org/attachments/4cc766ec-7191-4dad-a25a-1c30a13ffc9b)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#1079
No description provided.