← Back to Pull requests

fix(project-io): read long recordings in 1 MiB windows (relates to #2477) #2478

Closed
unknown closed this pull request without merging on Oct 23, 2026 04:44 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 04:10 UTC
Author

Summary

thirty-minute recording Save and bind preserve full identity through two page reopens exceeded its 180 s case budget on every CI Linux host. It has failed web_runtime_host and web_toolchain_conformance on netcup and on the en-home overflow runner since 2026-10-21. The diagnosis is on #2477.

  • Cause. Each OPFS read_range pays a fixed Asyncify suspend, a per-segment handle lookup, then getFile, slice and arrayBuffer. The three bounded loops (Save/bind verification, recording scan, discovery inventory) read in 64 KiB windows: about 5,300 calls and 9–12 s per full verification of the 345 MB file. Hashing that file takes 1.5 s (PicoSHA2, em++ -O3, 220 MiB/s on the same host).

  • Fix. All three windows become 1 MiB. Measured on the en-home CI-class host, the case drops from 238 s to 68 s (4 MiB would give 57 s). Every byte is still hashed, with unchanged length, EOF, short-read, zero-progress and no-fallback checks. Creator startup discovery with a long recording speeds up the same way.

  • Test fixtures keep their window shape. The 131,089-byte and 192,124-byte fixtures existed to span three 64 KiB windows. They become 2,097,169 bytes and a 2,158,204-byte WAV, so the multi-window, boundary-fault, truncation and EOF cases still cross windows. Every new literal comes from independent Python hashlib/struct, and the same generator reproduces every old literal. Fixtures that pin no window are untouched.

  • Web witnesses seed in one complete write. The test build's immutable observer writes two bytes per call; that is covered by its own short-write test. The 128 KiB seed already took ~40 s per page on unpatched main, and a 2 MiB seed exceeded the budget.
  • No case or RPC budget, journey leg or assertion of the failing test changes.

    Related Issue

    Related issue: Relates to #2477

    Verification

    All runs were on the en-home WSL runner host (20 threads, 31 GB), which fails this case in CI. Commit 9c1f082e was applied to 469f4ad.

  • Diagnosis, in a measurement-only build that is not committed:

  • - 238 s per-RPC breakdown on main;
    - window sweep: 64 KiB 238 s, 1 MiB 68 s, 4 MiB 57 s;
    - PicoSHA2 in Wasm: 1.49 s for 345,600,056 bytes.
  • Native (build/core/dev), all pass: lmdj_performance_recording_verification_tests 2.7 s, lmdj_performance_recording_scan_tests 4.9 s, lmdj_project_bundle_transfer_tests 6.1 s, lmdj_facade_performance_recording_metadata_tests 1.6 s, lmdj_web_recording_metadata_query_tests 1.2 s.

  • Mutation. I restored the 64 KiB windows in the product only and rebuilt. Three suites fail at their intended assertions:

  • - performance_recording_verification_test.cpp:202 maximum_request == 1048576;
    - performance_recording_scan_test.cpp:270, the second-window fault;
    - performance_recording_metadata_test.cpp:195, three windows plus EOF.

    After restoring the fix with a fresh mtime and rebuilding, all five pass.
  • Full scripts/web-toolchain-conformance.sh proof: PASS (882 s).

  • - Project I/O Chromium 49 passed; WebKit 39 passed, 10 skipped.
    - Audio Chromium 38 passed, including the thirty-minute case under the unchanged 180 s budget.
    - Transport OPFS WebKit 1 passed.
    - netcup CI job 120191630506 has the same counts: WebKit 10 skipped (platform limitations), and its audio leg is 37 passed / 1 failed on this case.
  • Before the seeding fix, the same proof failed exactly the three changed Project I/O witnesses at native-suite-start. A direct page probe showed the 2 MiB seed still unfinished after 360 s, while unpatched main finished its 128 KiB seed in 40 s.

  • scripts/docs-site.sh check: 179/179 tests; 51 routes and internal links valid.

  • Not run locally: the web_runtime_host lane proof, the Creator lane, and sanitizer, macOS and stress lanes. They are left to the selected batch. #2477 closes only after a real batch shows these lanes green.
  • PR Review

    Exact-head review evidence for 9c1f082e will be collected with scripts/ci/review_wait.py before merge.

    CI Scope

    Expected mode: full
    Expected selected lanes: ci_contract core_asan core_coverage core_macos core_ubuntu creator deploy_contract docs_static package portal web_runtime_host web_runtime_lab web_toolchain
    Expected skipped lanes: none
    ci:full required: no
    Reason: Project I/O product code plus its Native and Web tests and two Portal pages. The selection follows the comparable #2439, which touched the same paths; the authenticated remote scope is authoritative.

    Version Management

    Version impact: compatible internal Project I/O PATCH debt under #2237
    Reason: internal read-window constant; no API/ABI, Contract, Project Truth, key, dependency, manifest, Product, Assembly, Build or snapshot change.

    Documentation Impact

    Documentation impact: required
    Affected portal pages: /core/modules/project-io/ /platform/storage/
    Reason: both pages stated the 64 KiB window and the old composite OPFS fixture size; they now state the 1 MiB windows, the reason and 2,158,204 bytes / 539,537 frames.

    Pitfall Impact

    Pitfall impact: none — reason: a product read-path defect now caught by maximum_request == 1048576 and the three-window counts; the seeding constraint is recorded at both witnesses.

    Release Impact

    Release impact: none
    Candidate tag: none
    Profile: none
    Channel: none
    Intent disposition: none

    🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: endaye Review duration: 34m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2478"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%
    Repository