editor: make refusal timing checks stable under normal dev-01 load #1074

Closed
opened 2026-11-11 10:53:04 +00:00 by kayg · 12 comments
Owner

The refusal-performance vitest file uses wall-clock 16 ms assertions for large-paste handling and draining an offline backlog. Preserve its functional durability and payload checks, and put timing qualification in the controlled performance harness. Reproduction evidence is in the comments. The rows restack does not relax these assertions.

The refusal-performance vitest file uses wall-clock 16 ms assertions for large-paste handling and draining an offline backlog. Preserve its functional durability and payload checks, and put timing qualification in the controlled performance harness. Reproduction evidence is in the comments. The rows restack does not relax these assertions.
Author
Owner

rows restack qualification on dev-01 through the normal ~/bin/slot, in Nix:

  • dev 31972329b: backlog test failed in 3/10 repeats.
  • #904 runtime 1382d51b6 (current head differs only in budget metadata): backlog test failed in 4/10 repeats.
  • ascii refused-paste test: 10/10 passed on each side after one failure in the full #904 suite. this first-run failure qualifies for the brief's flake rule; the backlog failure reproduces and remains blocking.

Commands, from packages/editor, each repeated ten times per side: bunx vitest run test/refusal-performance.test.ts -t "a 10,000-edit offline backlog" and bunx vitest run test/refusal-performance.test.ts -t "typing and collaborator packets.*ascii". Neither test assertion was changed.

raw repetition logs. Do not infer product latency from these wall-clock unit-test results; actual typing/save/list qualification runs on the perf VMs with controls.

rows restack qualification on dev-01 through the normal `~/bin/slot`, in Nix: - dev `31972329b`: backlog test failed in 3/10 repeats. - #904 runtime `1382d51b6` (current head differs only in budget metadata): backlog test failed in 4/10 repeats. - ascii refused-paste test: 10/10 passed on each side after one failure in the full #904 suite. this first-run failure qualifies for the brief's flake rule; the backlog failure reproduces and remains blocking. Commands, from `packages/editor`, each repeated ten times per side: `bunx vitest run test/refusal-performance.test.ts -t "a 10,000-edit offline backlog"` and `bunx vitest run test/refusal-performance.test.ts -t "typing and collaborator packets.*ascii"`. Neither test assertion was changed. [raw repetition logs](https://git.kayg.org/attachments/3f379edd-6883-46c5-b8c3-8afff8002a3a). Do not infer product latency from these wall-clock unit-test results; actual typing/save/list qualification runs on the perf VMs with controls.
Author
Owner

fresh qualification after dev advanced to 437f9ec8923b3d380506f48a77eb11493ef66fb0: editor full suites hit the link-rank 16 ms assertion on dev and #887, and the tag-rank 2 ms assertion on #875. no editor implementation or assertion was changed.

repeated the affected ranking tests ten times on dev and each of #887/#875/#877/#878/#904, through one ordinary ~/bin/slot job on dev-01, in Nix. 60 runs, 0 failures. the ranking first-run failures qualify for the brief’s flake exception. all repeat logs.

# run ten times in each worktree's packages/editor
bunx vitest run test/link-rank.test.ts test/tag-rank.test.ts -t 'ranks a keystroke|stays instant'

this does not waive the separate offline-backlog assertion: it previously reproduced 3/10 on dev and 4/10 on #904, and failed again in the fresh dev/#887 full suites. that remains blocking. the ASCII paste test remains covered by the earlier 10/10 pass on both arms. no timing threshold was relaxed.

fresh qualification after dev advanced to `437f9ec8923b3d380506f48a77eb11493ef66fb0`: editor full suites hit the link-rank 16 ms assertion on dev and #887, and the tag-rank 2 ms assertion on #875. no editor implementation or assertion was changed. repeated the affected ranking tests ten times on dev and **each of #887/#875/#877/#878/#904**, through one ordinary `~/bin/slot` job on dev-01, in Nix. **60 runs, 0 failures**. the ranking first-run failures qualify for the brief’s flake exception. [all repeat logs](https://git.kayg.org/attachments/dd69fe02-9642-4be9-a055-a4ebe3fcfbc4). ```sh # run ten times in each worktree's packages/editor bunx vitest run test/link-rank.test.ts test/tag-rank.test.ts -t 'ranks a keystroke|stays instant' ``` this does not waive the separate offline-backlog assertion: it previously reproduced 3/10 on dev and 4/10 on #904, and failed again in the fresh dev/#887 full suites. that remains blocking. the ASCII paste test remains covered by the earlier 10/10 pass on both arms. no timing threshold was relaxed.
Author
Owner

Investigation started on pinned dev 437f9ec8923b3d380506f48a77eb11493ef66fb0. No overlapping open ranking/backlog PR found. Collecting 25 fresh-process repetitions of all three affected tests on dev-01 under Nix and one ordinary ~/bin/slot, with each receipt callback and MessageChannel step retained plus GC observations. Diagnostic changes stay in the temporary VM worktree; no threshold change proposed yet. Noted that backlog bestRound retries grow the same document to 20k/30k edits, while rank guards already select best-of-8/9 timings. Build slots are occupied, so the diagnostic job is waiting normally.

Investigation started on pinned dev `437f9ec8923b3d380506f48a77eb11493ef66fb0`. No overlapping open ranking/backlog PR found. Collecting 25 fresh-process repetitions of all three affected tests on dev-01 under Nix and one ordinary `~/bin/slot`, with each receipt callback and MessageChannel step retained plus GC observations. Diagnostic changes stay in the temporary VM worktree; no threshold change proposed yet. Noted that backlog bestRound retries grow the same document to 20k/30k edits, while rank guards already select best-of-8/9 timings. Build slots are occupied, so the diagnostic job is waiting normally.
Author
Owner

At 18:45 IST, dev-01 reported load averages 47.99 / 44.22 / 41.63 (12 vCPUs), all six slot locks occupied, and the diagnostic job remains queued. One lock is held by a calternal process rather than the original slot shell; no other job was stopped. Added per-channel wall and process-CPU timings to the temporary probe so scheduler delay can be distinguished from callback CPU work. This is environment evidence, not yet a root-cause conclusion.

At 18:45 IST, dev-01 reported load averages 47.99 / 44.22 / 41.63 (12 vCPUs), all six slot locks occupied, and the diagnostic job remains queued. One lock is held by a calternal process rather than the original slot shell; no other job was stopped. Added per-channel wall and process-CPU timings to the temporary probe so scheduler delay can be distinguished from callback CPU work. This is environment evidence, not yet a root-cause conclusion.
Author
Owner

25 fresh-process dev diagnostics completed on 437f9ec8923b3d380506f48a77eb11493ef66fb0, dev-01, Nix, one ordinary ~/bin/slot job. Backlog 11/25 passed, link ranking 24/25 passed, tag ranking 24/25 passed. No product code or assertion was changed. Across 10,148 MessageChannel callbacks: p50 3.187 ms, p95 14.708 ms, p99 26.477 ms, max 86.464 ms. 416 exceeded 16 ms; 361 used less than 16 ms of process CPU (which includes other V8 threads), demonstrating substantial scheduling delay. The first rounds also overlap GC. Timers show fractional-microsecond values rather than a 16 ms resolution problem.

Source inspection found a separate real scalability issue: every batch invalidates both timestamp caches, then the changed callback publishes status by walking all remaining edits twice, outside the 4 ms drain budget. Across a 10k backlog that is quadratic work and iterator allocation. A diagnostic method profile locates multi-ms time in those scans, but its instrumentation adds allocations, so it is not a performance qualification. A deterministic operation-count regression test is queued; it requires timestamp publication to avoid ledger traversal. The proposed fix is an indexed timestamp minimum with O(1) reads and O(log n) updates inside the existing bounded drain.

A separate warm-up experiment retains the original max/threshold assertions. Warm-up alone has already failed, so no threshold relaxation or percentile substitution is justified by these shared-host results. Raw baseline step/GC/rank logs and the backlog probe are attached.

25 fresh-process dev diagnostics completed on `437f9ec8923b3d380506f48a77eb11493ef66fb0`, dev-01, Nix, one ordinary `~/bin/slot` job. Backlog **11/25 passed**, link ranking **24/25 passed**, tag ranking **24/25 passed**. No product code or assertion was changed. Across **10,148 MessageChannel callbacks**: p50 3.187 ms, p95 14.708 ms, p99 26.477 ms, max 86.464 ms. 416 exceeded 16 ms; 361 used less than 16 ms of process CPU (which includes other V8 threads), demonstrating substantial scheduling delay. The first rounds also overlap GC. Timers show fractional-microsecond values rather than a 16 ms resolution problem. Source inspection found a separate real scalability issue: every batch invalidates both timestamp caches, then the changed callback publishes status by walking all remaining edits twice, **outside** the 4 ms drain budget. Across a 10k backlog that is quadratic work and iterator allocation. A diagnostic method profile locates multi-ms time in those scans, but its instrumentation adds allocations, so it is not a performance qualification. A deterministic operation-count regression test is queued; it requires timestamp publication to avoid ledger traversal. The proposed fix is an indexed timestamp minimum with O(1) reads and O(log n) updates inside the existing bounded drain. A separate warm-up experiment retains the original max/threshold assertions. Warm-up alone has already failed, so no threshold relaxation or percentile substitution is justified by these shared-host results. Raw baseline step/GC/rank logs and the backlog probe are attached.
Author
Owner

Implementation plan for the real unbudgeted status work:

  • Keep the receipt authority, 64-edit cap, 4 ms deadline, and MessageChannel delivery unchanged.
  • Replace lazy full-ledger timestamp scans with two binary minimum heaps (local and held). Entries keep an index in their existing edit object; the heaps together hold one reference per live edit. O(n) space, O(log n) insertion/removal, O(1) timestamp reads. No separate id map or sort. Timestamp removal happens inside the already bounded drain loop.
  • Add an operation-count regression that proves status publication does not traverse a partially drained 10k ledger, plus heap ordering/removal tests with shuffled timestamps. Preserve the existing Saved/content/yield/no-zero-timer checks.
  • Qualify against dev with the actual SyncClient typing and offline-backlog paths on the perf VMs, using FIFO perf-turn, both locks, same-session dev/dev controls and interleaved dev/fix. Retain raw per-step wall and thread-CPU data. No threshold increase.
failure effect detection recovery/test
stale heap index wrong oldest timestamp shuffled add/remove oracle and exact status assertions index updated on every swap, retired entry invalidated
refusal/reconnect during a drain pending state must remain honest existing receipt authority tests and backlog integration cancel tasks as today; indexes retire only when the ledger retires an edit
shared-host scheduling / GC noisy wall maximum raw wall vs CPU, GC evidence, controls warm-up; keep isolated frame-budget qualification; do not increase budgets

Gates: demonstrate the status-work test failing on dev, then passing with the fix; 30 fresh-process passes per requested test on dev+fix under slot/Nix; editor regression suite and type check; controlled typing/backlog comparison. The warm-up-only experiment is still running and is insufficient so far.

Implementation plan for the real unbudgeted status work: - Keep the receipt authority, 64-edit cap, 4 ms deadline, and MessageChannel delivery unchanged. - Replace lazy full-ledger timestamp scans with two binary minimum heaps (local and held). Entries keep an index in their existing edit object; the heaps together hold one reference per live edit. O(n) space, O(log n) insertion/removal, O(1) timestamp reads. No separate id map or sort. Timestamp removal happens inside the already bounded drain loop. - Add an operation-count regression that proves status publication does not traverse a partially drained 10k ledger, plus heap ordering/removal tests with shuffled timestamps. Preserve the existing Saved/content/yield/no-zero-timer checks. - Qualify against dev with the actual SyncClient typing and offline-backlog paths on the perf VMs, using FIFO perf-turn, both locks, same-session dev/dev controls and interleaved dev/fix. Retain raw per-step wall and thread-CPU data. No threshold increase. | failure | effect | detection | recovery/test | |---|---|---|---| | stale heap index | wrong oldest timestamp | shuffled add/remove oracle and exact status assertions | index updated on every swap, retired entry invalidated | | refusal/reconnect during a drain | pending state must remain honest | existing receipt authority tests and backlog integration | cancel tasks as today; indexes retire only when the ledger retires an edit | | shared-host scheduling / GC | noisy wall maximum | raw wall vs CPU, GC evidence, controls | warm-up; keep isolated frame-budget qualification; do not increase budgets | Gates: demonstrate the status-work test failing on dev, then passing with the fix; 30 fresh-process passes per requested test on dev+fix under slot/Nix; editor regression suite and type check; controlled typing/backlog comparison. The warm-up-only experiment is still running and is insufficient so far.
Author
Owner

Implementation is pushed in #1078 (1c71b9ba0); the status-work regression was demonstrated red on dev (19,872 visits). Validation is queued on both build VMs through their normal slots. On dev-02 the holder labels looked empty, but /proc/locks confirms all three slot inodes remain locked with original owner PIDs no longer visible. Current inherited descriptors are held by processes 2812556/2812574 (3.lock), 2819119/2819247/2819344 (1.lock), and 2819238/2819256 (2.lock), plus a sleep child on 1.lock. I have not stopped or changed any other lane. The queued x86 validation and ARM functional/portable-JS build jobs remain in the foreground workflow. The optional prebuilt dev/dev perf diagnostic also queued behind another perf lane; no perf locks were taken by this lane and no measurement is claimed from it. Final qualification still needs fresh controls with both bundles staged.

Implementation is pushed in #1078 (`1c71b9ba0`); the status-work regression was demonstrated red on dev (19,872 visits). Validation is queued on both build VMs through their normal slots. On dev-02 the holder labels looked empty, but `/proc/locks` confirms all three slot inodes remain locked with original owner PIDs no longer visible. Current inherited descriptors are held by processes 2812556/2812574 (3.lock), 2819119/2819247/2819344 (1.lock), and 2819238/2819256 (2.lock), plus a sleep child on 1.lock. I have not stopped or changed any other lane. The queued x86 validation and ARM functional/portable-JS build jobs remain in the foreground workflow. The optional prebuilt dev/dev perf diagnostic also queued behind another perf lane; no perf locks were taken by this lane and no measurement is claimed from it. Final qualification still needs fresh controls with both bundles staged.
Author
Owner

intermediate validation for 1c71b9ba0: x86 slot/nix fresh-process repeats are 30/30 per affected test; full editor suite 565/565. attached raw logs also retain the failing type check and the +178 gzip first-paint comparison, which are being addressed before final qualification. current branch remains draft. this is not the final-head gate evidence.

intermediate validation for 1c71b9ba0: x86 slot/nix fresh-process repeats are 30/30 per affected test; full editor suite 565/565. attached raw logs also retain the failing type check and the +178 gzip first-paint comparison, which are being addressed before final qualification. current branch remains draft. this is not the final-head gate evidence.
Author
Owner

final functional validation, head 3d9a055bf5, base 437f9ec892

  • each affected test: 30/30 fresh-process passes on dev+fix, x86 dev-01, nix + ~/bin/slot.
  • editor type check, including the standalone perf harness: pass.
  • heap / bounded-status / authority smoke: 11/11.
  • full editor suite: 45 files, 565/565 tests.
  • first-paint JS: brotli 228076 → 228071 bytes (-5), the documented gated bundle metric; CSS unchanged. raw 802693 → 802770 (+77), gzip 267949 → 268035 (+86), disclosed separately. no bundle allowance changed.

commands, run inside the slot/nix job:

cd packages/editor
bun run check
bunx vitest run test/pending-times.test.ts test/receipt-status-work.test.ts test/receipts.test.ts --maxWorkers=1
# 30 separate invocations
bunx vitest run test/refusal-performance.test.ts test/link-rank.test.ts test/tag-rank.test.ts -t 'a 10,000-edit offline backlog|ranks a keystroke|keeps matching bounded' --maxWorkers=1
bunx vitest run --maxWorkers=1

raw outputs and the build/repeat driver are attached. the old intermediate type errors are fixed and are absent from this run. the redundant arm job was stopped while still queued, so no arm pass claim is made. controlled perf-turn dev/dev and dev/fix qualification is queued, with both bundles staged and sha256 verified; no perf pass is claimed yet.

final functional validation, head 3d9a055bf55a04c860327af5d5ac4d8656ddafff, base 437f9ec8923b3d380506f48a77eb11493ef66fb0 - each affected test: 30/30 fresh-process passes on dev+fix, x86 dev-01, nix + ~/bin/slot. - editor type check, including the standalone perf harness: pass. - heap / bounded-status / authority smoke: 11/11. - full editor suite: 45 files, 565/565 tests. - first-paint JS: brotli 228076 → 228071 bytes (-5), the documented gated bundle metric; CSS unchanged. raw 802693 → 802770 (+77), gzip 267949 → 268035 (+86), disclosed separately. no bundle allowance changed. commands, run inside the slot/nix job: ```sh cd packages/editor bun run check bunx vitest run test/pending-times.test.ts test/receipt-status-work.test.ts test/receipts.test.ts --maxWorkers=1 # 30 separate invocations bunx vitest run test/refusal-performance.test.ts test/link-rank.test.ts test/tag-rank.test.ts -t 'a 10,000-edit offline backlog|ranks a keystroke|keeps matching bounded' --maxWorkers=1 bunx vitest run --maxWorkers=1 ``` raw outputs and the build/repeat driver are attached. the old intermediate type errors are fixed and are absent from this run. the redundant arm job was stopped while still queued, so no arm pass claim is made. controlled perf-turn dev/dev and dev/fix qualification is queued, with both bundles staged and sha256 verified; no perf pass is claimed yet.
Author
Owner

controlled perf-turn results, head 3d9a055bf5 versus dev 437f9ec892

both bundles were built on dev-01 in nix + ~/bin/slot, relayed through control, and sha256 checked before entering perf-turn. order: dev/dev controls, dev/fix/dev/fix, dev/dev controls. perf-01 lock first, perf-02 second; both held throughout measurement, both now released. Node v22.23.3, same session.

all eight arms qualified. each arm has 1 cold + 20 measured 10k backlogs after warm-up, 20,000 measured typing keys, 1,200 link samples, and 700 tag samples. fix totals: 42 backlogs / 6,636 callbacks, max 0.855211 ms, including cold maxima 0.834482 and 0.855211 ms. links max 1.996091 ms; tags max 0.573982 ms, with both tag p99s below 2 ms. the separate 16 ms maxima remain strict, so percentiles do not hide a frame-blocking receipt or picker sample. these are Node task/CPU measurements, not browser frame measurements.

values below are ms. all deltas are shown, including small positive typing/rank deltas:

metric pair 1 dev pair 1 fix delta pair 2 dev pair 2 fix delta four dev controls min–max
receipt step p50 wall 0.147798 0.046368 -68.63% 0.153679 0.047691 -68.97% 0.141736–0.149873
receipt step p99 wall 0.352264 0.218061 -38.10% 0.388423 0.231907 -40.30% 0.340512–0.430432
receipt step max wall 2.351493 0.834482 -64.51% 2.367280 0.855211 -63.87% 2.321878–2.527359
whole backlog mean CPU 59.752500 43.722550 -26.83% 60.317950 45.553200 -24.48% 58.107650–60.334050
whole backlog mean wall 393.608653 378.158233 -3.93% 392.970543 378.967472 -3.56% 391.557234–394.345521
typing key p50 wall 0.015339 0.015819 +3.13% 0.015839 0.015870 +0.20% 0.015119–0.015619
typing key mean wall 0.020504 0.021281 +3.79% 0.021111 0.021539 +2.03% 0.019979–0.021859
typing key p99 wall 0.046980 0.049324 +4.99% 0.050174 0.052088 +3.81% 0.045987–0.052680
link p99 wall 1.505948 1.622528 +7.74% 1.549900 1.620673 +4.57% 1.533478–1.725854
tag p99 wall 0.503369 0.505573 +0.44% 0.506815 0.463462 -8.55% 0.503199–0.573953

receipt work and backlog CPU improve well beyond control variation. ranking product code is unchanged; both warmed rank p99s remain within/below the control envelope. typing wall changes are within dev/dev variation, but per-key threadCpuUsage is quantized around 4 ms on this VM (many zeros, occasional 4 ms increments). its per-key CPU percentiles and sums must not be treated as microsecond measurements. a continuous batch CPU follow-up is being built before the final no-regression conclusion.

sha256 dev: 4c36a4d8026a75910412ec0de4e090b017456788a19b3ad2a652ce9790528e4a
sha256 fix: 589db33f74233b78b4d193b7f90934eebb79720595940f287394f9bb14d2ff37

the attached archive contains every raw step/key/rank sample, all eight JSON outputs, the run order/exit log, and the perf-turn payload.

controlled perf-turn results, head 3d9a055bf55a04c860327af5d5ac4d8656ddafff versus dev 437f9ec8923b3d380506f48a77eb11493ef66fb0 both bundles were built on dev-01 in nix + ~/bin/slot, relayed through control, and sha256 checked before entering perf-turn. order: dev/dev controls, dev/fix/dev/fix, dev/dev controls. perf-01 lock first, perf-02 second; both held throughout measurement, both now released. Node v22.23.3, same session. all eight arms qualified. each arm has 1 cold + 20 measured 10k backlogs after warm-up, 20,000 measured typing keys, 1,200 link samples, and 700 tag samples. fix totals: 42 backlogs / 6,636 callbacks, max 0.855211 ms, including cold maxima 0.834482 and 0.855211 ms. links max 1.996091 ms; tags max 0.573982 ms, with both tag p99s below 2 ms. the separate 16 ms maxima remain strict, so percentiles do not hide a frame-blocking receipt or picker sample. these are Node task/CPU measurements, not browser frame measurements. values below are ms. all deltas are shown, including small positive typing/rank deltas: | metric | pair 1 dev | pair 1 fix | delta | pair 2 dev | pair 2 fix | delta | four dev controls min–max | |---|---:|---:|---:|---:|---:|---:|---:| | receipt step p50 wall | 0.147798 | 0.046368 | -68.63% | 0.153679 | 0.047691 | -68.97% | 0.141736–0.149873 | | receipt step p99 wall | 0.352264 | 0.218061 | -38.10% | 0.388423 | 0.231907 | -40.30% | 0.340512–0.430432 | | receipt step max wall | 2.351493 | 0.834482 | -64.51% | 2.367280 | 0.855211 | -63.87% | 2.321878–2.527359 | | whole backlog mean CPU | 59.752500 | 43.722550 | -26.83% | 60.317950 | 45.553200 | -24.48% | 58.107650–60.334050 | | whole backlog mean wall | 393.608653 | 378.158233 | -3.93% | 392.970543 | 378.967472 | -3.56% | 391.557234–394.345521 | | typing key p50 wall | 0.015339 | 0.015819 | +3.13% | 0.015839 | 0.015870 | +0.20% | 0.015119–0.015619 | | typing key mean wall | 0.020504 | 0.021281 | +3.79% | 0.021111 | 0.021539 | +2.03% | 0.019979–0.021859 | | typing key p99 wall | 0.046980 | 0.049324 | +4.99% | 0.050174 | 0.052088 | +3.81% | 0.045987–0.052680 | | link p99 wall | 1.505948 | 1.622528 | +7.74% | 1.549900 | 1.620673 | +4.57% | 1.533478–1.725854 | | tag p99 wall | 0.503369 | 0.505573 | +0.44% | 0.506815 | 0.463462 | -8.55% | 0.503199–0.573953 | receipt work and backlog CPU improve well beyond control variation. ranking product code is unchanged; both warmed rank p99s remain within/below the control envelope. typing wall changes are within dev/dev variation, but per-key threadCpuUsage is quantized around 4 ms on this VM (many zeros, occasional 4 ms increments). its per-key CPU percentiles and sums must not be treated as microsecond measurements. a continuous batch CPU follow-up is being built before the final no-regression conclusion. sha256 dev: `4c36a4d8026a75910412ec0de4e090b017456788a19b3ad2a652ce9790528e4a` sha256 fix: `589db33f74233b78b4d193b7f90934eebb79720595940f287394f9bb14d2ff37` the attached archive contains every raw step/key/rank sample, all eight JSON outputs, the run order/exit log, and the perf-turn payload.
Author
Owner

final typing confirmation and #1074 closeout, head 3d9a055bf5

root cause is mixed. the receipt drain yielded after 4 ms / 64 edits, but each status publication then scanned the remaining ledger twice outside that deadline. the deterministic regression records 19,872 ledger visits after the first 64-edit drain on dev. two indexed timestamp heaps now retire entries inside the existing bounded drain and publish exact minima in O(1). final bookkeeping also avoids temporary ledger arrays.

ordinary shared build-host scheduling/GC/JIT noise compounded this real scalability defect; timer resolution was not the cause. 25 fresh-process diagnostics retained 10,148 step samples: backlog 11/25 passes, link 24/25, tag 24/25. warming alone still failed backlog 17/30 and tags 2/30. rank product code is unchanged. functional/structural checks run in Vitest; the warmed perf harness retains p50/p95/p99 and a separate strict 16 ms maximum for receipt steps and both pickers. tag p99 remains below 2 ms. no timing threshold was raised.

25-run raw diagnostics, final-head functional gates, primary controlled perf, all raw samples and deltas.

final typing follow-up ran 22:54:20–22:54:40 IST on 11 november, Node v22.23.3, through ~/bin/perf-turn with both perf locks. both units are inactive and both holds released. it reused the SHA-verified slot/Nix-built primary bundles, editing only harness instrumentation and the entry loop. the attached transformation asserts that the entire bundled product prefix and typing fixture remain byte-identical. a queued redundant build was stopped before execution; no slot bypass was used.

each arm warms five fixtures, then samples one continuous thread-CPU window across 100 fresh fixtures and 120,000 key/check/receipt operations, including setup. 100,000 measured key wall samples are summarized per arm. this avoids the roughly 4 ms accounting ticks that make the primary per-key CPU samples unsuitable for microsecond conclusions. order is controls dev/dev, dev/fix, fix/dev, controls dev/dev.

arm continuous CPU ms continuous wall ms key p50 ms key p99 ms key max ms
control1-dev 2041.685 2050.592 0.014167 0.036859 1.749108
control2-dev 2021.392 2027.321 0.014177 0.036288 1.618365
pair1-dev 2140.204 2153.403 0.014447 0.041197 2.301965
pair1-fix 2117.593 2127.855 0.013966 0.041097 3.179320
pair2-fix 2224.536 2235.146 0.014287 0.044233 7.335543
pair2-dev 2406.077 2423.214 0.014548 0.045705 11.629173
control3-dev 2253.220 2272.623 0.014037 0.042971 8.893453
control4-dev 2212.526 2224.692 0.014186 0.043372 5.174612
comparison CPU delta wall delta key p50 delta key p99 delta key max delta
opening dev/dev -0.99% -1.13% +0.07% -1.55% -7.47%
pair 1 fix/dev -1.06% -1.19% -3.33% -0.24% +38.11%
pair 2 fix/dev, reversed order -7.55% -7.76% -1.79% -3.22% -36.92%
closing dev/dev -1.81% -2.11% +1.06% +0.93% -41.82%

no typing regression is observed: both paired CPU and wall windows are lower; both fix CPU totals are inside the four dev-control envelope (2021.392–2253.220 ms). the reversed pair also exposes session drift, so the larger negative delta is not claimed as a precise product speedup. key maxima are noisy, including a positive +38.11% pair-1 delta, and are disclosed above.

primary fix qualification: 42 backlogs / 6,636 callbacks, maximum 0.855211 ms including cold runs; receipt p50 about 69% lower; whole backlog CPU 24–27% lower. link maximum 1.996091 ms, tag maximum 0.573982 ms. all eight primary arms qualified with unchanged budgets.

final-head repeat counts: backlog 30/30, link 30/30, tag 30/30 in separate fresh Vitest processes on dev-01 inside Nix + ~/bin/slot. full editor 565/565 across 45 files; heap/status/authority smoke 11/11; editor/perf TypeScript checks pass. web check: 0 errors, 19 warnings. canonical first-paint brotli 228076→228071 bytes (-5); raw/gzip +77/+86 bytes are disclosed in the functional attachment.

exact repeat command from packages/editor, invoked 30 times:

bunx vitest run test/refusal-performance.test.ts test/link-rank.test.ts test/tag-rank.test.ts -t 'a 10,000-edit offline backlog|ranks a keystroke|keeps matching bounded' --maxWorkers=1

other checks: bun run check; bunx vitest run --maxWorkers=1; cd apps/web && bun run check. the attached scripts and prior attachments retain the full build/slot/Nix commands.

probe SHA256 dev: 8e376792caabf23c23a1ed15899b5ac9677c24a82f2306b7a41734f7f6a5f7d9
probe SHA256 fix: ccec99c5482714e0c7f067a05fde4bac24a3ea3b07c82e46e6b7fa8d3ed245d8

PR #1078 is ready for orchestrator review. no merge performed. attachment includes the eight CPU-window JSON results, run log, driver, exact instrumentation transformation, derived probes, and web-check log.

final typing confirmation and #1074 closeout, head 3d9a055bf55a04c860327af5d5ac4d8656ddafff root cause is mixed. the receipt drain yielded after 4 ms / 64 edits, but each status publication then scanned the remaining ledger twice outside that deadline. the deterministic regression records 19,872 ledger visits after the first 64-edit drain on dev. two indexed timestamp heaps now retire entries inside the existing bounded drain and publish exact minima in O(1). final bookkeeping also avoids temporary ledger arrays. ordinary shared build-host scheduling/GC/JIT noise compounded this real scalability defect; timer resolution was not the cause. 25 fresh-process diagnostics retained 10,148 step samples: backlog 11/25 passes, link 24/25, tag 24/25. warming alone still failed backlog 17/30 and tags 2/30. rank product code is unchanged. functional/structural checks run in Vitest; the warmed perf harness retains p50/p95/p99 and a separate strict 16 ms maximum for receipt steps and both pickers. tag p99 remains below 2 ms. no timing threshold was raised. [25-run raw diagnostics](https://git.kayg.org/kayg/calternal/issues/1074#issuecomment-91380), [final-head functional gates](https://git.kayg.org/kayg/calternal/issues/1074#issuecomment-91501), [primary controlled perf, all raw samples and deltas](https://git.kayg.org/kayg/calternal/issues/1074#issuecomment-91546). final typing follow-up ran 22:54:20–22:54:40 IST on 11 november, Node v22.23.3, through ~/bin/perf-turn with both perf locks. both units are inactive and both holds released. it reused the SHA-verified slot/Nix-built primary bundles, editing only harness instrumentation and the entry loop. the attached transformation asserts that the entire bundled product prefix and typing fixture remain byte-identical. a queued redundant build was stopped before execution; no slot bypass was used. each arm warms five fixtures, then samples one continuous thread-CPU window across 100 fresh fixtures and 120,000 key/check/receipt operations, including setup. 100,000 measured key wall samples are summarized per arm. this avoids the roughly 4 ms accounting ticks that make the primary per-key CPU samples unsuitable for microsecond conclusions. order is controls dev/dev, dev/fix, fix/dev, controls dev/dev. | arm | continuous CPU ms | continuous wall ms | key p50 ms | key p99 ms | key max ms | |---|---:|---:|---:|---:|---:| | control1-dev | 2041.685 | 2050.592 | 0.014167 | 0.036859 | 1.749108 | | control2-dev | 2021.392 | 2027.321 | 0.014177 | 0.036288 | 1.618365 | | pair1-dev | 2140.204 | 2153.403 | 0.014447 | 0.041197 | 2.301965 | | pair1-fix | 2117.593 | 2127.855 | 0.013966 | 0.041097 | 3.179320 | | pair2-fix | 2224.536 | 2235.146 | 0.014287 | 0.044233 | 7.335543 | | pair2-dev | 2406.077 | 2423.214 | 0.014548 | 0.045705 | 11.629173 | | control3-dev | 2253.220 | 2272.623 | 0.014037 | 0.042971 | 8.893453 | | control4-dev | 2212.526 | 2224.692 | 0.014186 | 0.043372 | 5.174612 | | comparison | CPU delta | wall delta | key p50 delta | key p99 delta | key max delta | |---|---:|---:|---:|---:|---:| | opening dev/dev | -0.99% | -1.13% | +0.07% | -1.55% | -7.47% | | pair 1 fix/dev | -1.06% | -1.19% | -3.33% | -0.24% | +38.11% | | pair 2 fix/dev, reversed order | -7.55% | -7.76% | -1.79% | -3.22% | -36.92% | | closing dev/dev | -1.81% | -2.11% | +1.06% | +0.93% | -41.82% | no typing regression is observed: both paired CPU and wall windows are lower; both fix CPU totals are inside the four dev-control envelope (2021.392–2253.220 ms). the reversed pair also exposes session drift, so the larger negative delta is not claimed as a precise product speedup. key maxima are noisy, including a positive +38.11% pair-1 delta, and are disclosed above. primary fix qualification: 42 backlogs / 6,636 callbacks, maximum 0.855211 ms including cold runs; receipt p50 about 69% lower; whole backlog CPU 24–27% lower. link maximum 1.996091 ms, tag maximum 0.573982 ms. all eight primary arms qualified with unchanged budgets. final-head repeat counts: backlog 30/30, link 30/30, tag 30/30 in separate fresh Vitest processes on dev-01 inside Nix + ~/bin/slot. full editor 565/565 across 45 files; heap/status/authority smoke 11/11; editor/perf TypeScript checks pass. web check: 0 errors, 19 warnings. canonical first-paint brotli 228076→228071 bytes (-5); raw/gzip +77/+86 bytes are disclosed in the functional attachment. exact repeat command from packages/editor, invoked 30 times: ```sh bunx vitest run test/refusal-performance.test.ts test/link-rank.test.ts test/tag-rank.test.ts -t 'a 10,000-edit offline backlog|ranks a keystroke|keeps matching bounded' --maxWorkers=1 ``` other checks: `bun run check`; `bunx vitest run --maxWorkers=1`; `cd apps/web && bun run check`. the attached scripts and prior attachments retain the full build/slot/Nix commands. probe SHA256 dev: `8e376792caabf23c23a1ed15899b5ac9677c24a82f2306b7a41734f7f6a5f7d9` probe SHA256 fix: `ccec99c5482714e0c7f067a05fde4bac24a3ea3b07c82e46e6b7fa8d3ed245d8` PR #1078 is ready for orchestrator review. no merge performed. attachment includes the eight CPU-window JSON results, run log, driver, exact instrumentation transformation, derived probes, and web-check log.
Author
Owner

Fixed by #1078, merged to dev as 1a14e9f10.

Fixed by #1078, merged to dev as 1a14e9f10.
kayg closed this issue 2026-11-11 17:58:09 +00:00
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#1074
No description provided.