Skip to content

Reduce scanner overhead, recover stalled tracking and add clue rereading/replay tests - #67

Merged
senegrom merged 5 commits into
masterfrom
improve/scanner-hardening-20260921
Sep 21, 2026
Merged

senegrom merged 5 commits into
masterfrom
improve/scanner-hardening-20260921

Conversation

@senegrom

Copy link
Copy Markdown
Owner

All four requested additions — branch only

The previous PR66 was merged and its branch deleted by another client during this work. This follow-up is based on resulting master fc99ab178157df88cc657247dac63dc007c7adec, whose production tree is the inspected/tested baseline. Keep this PR a draft; the user requested these new changes on a branch, not merged or deployed.

1. Less preview overhead and useful bounded measurements

Deduplicate identical preview paints without skipping freshness/identity validation. Paint when pixels, geometry or visible results change; the independent watchdog can still remove stale overlays. Warm the live solver only when auto-solve is enabled. Bounded timing windows record painting, frame age, tracking latency, first completed reading and queue work; exported metrics contain no images or free-form data.

2. Recover from callback silence and stop repeated worker crashes

A silent video-frame callback mechanism falls back only when independent presented/decoded-frame evidence is currently advancing. Total frame counts subtract dropped frames, and a timer/media clock alone cannot authorize the fallback. Retire native callbacks after switching. Tracking failures back off for two and four seconds, then pause after the third consecutive failure with an explicit Restart live scanning control. A brief success does not erase the failure streak; sustained verified frames do. Manual capture remains available and stale evidence remains hidden.

3. Re-read a clue in the existing editor

Offer Re-read this clue only for eligible, unconfirmed numeric clues with matching photo geometry. Show a proposal without changing the field, puzzle, Play answers or review state. Use proposal copies the number to the draft; ordinary Save is still required to confirm it. Identical source pixels use a bounded cache; other photos, changed puzzles, manually edited drafts, confirmed clues, closed dialogs and cancelled work cannot receive a late proposal. Unsupported structural targets remain on their existing edit path.

4. Broader video and repeated-session coverage

Add a fixed first-three sample from the existing hash-selected Lexski image slice. The browser receives image pixels only and runs automatic detection, tracking and real OCR. Ground-truth corners and numbers remain outside the pipeline, used only for reporting. Record detection/read failures and unflagged discrepancies as explicit coverage results rather than claiming perfect recognition or removing hard cases.

Add 20 repeated camera sessions per browser, changing resolution and delaying real worker delivery. Check active workers, timer ownership, retained source/scratch images, queues, anchors and late results after Stop. The live solver is not warmed with auto-solve off. This is an owned-resource leak check, not a physical-device heap/battery measurement.

Verification so far

Head: c29abf290ee1d9dda16195dbbac540052da29c7b.
Exact source tree: 86e86be31192591c207b17843a37c3998e4b62ea.

  • Complete local JavaScript suite: 801 passed, zero failures/cancellations/skips, versus 774 on the baseline.
  • Seven focused Python tests passed (runtime-build contracts and motion annotations).
  • JavaScript syntax and whitespace checks passed.
  • The full exact candidate also passed all 801 tests on the hosted transfer runner before publication. The first transfer was rejected because its contents-only token could not change workflow files; no token permissions were escalated. Workflow changes were published through the authorized connector. Temporary transfer files/workflows are removed from this final tree.
  • New browser and independent exact-artifact acceptance results are pending. Unit counts do not substitute for them. Local browser navigation is blocked by the environment, so no local browser-pass claim is made.

Existing recognition, moving-video, solver, offline, backup/review/Play and privacy gates remain intact. New editor/soak checks are included in exact-artifact acceptance, and external replays run in Scanner quality.

See web/BRANCH_HARDENING.md. No OCR model, solver-derived clue substitution, identity-threshold relaxation or master update is part of this follow-up.

…anch

All four requested additions are implemented: deduplicated preview painting and bounded metrics/lazy live solver; silent video callback fallback only with independently advancing frame evidence and a tracking circuit breaker; explicit proposal-only single-clue editor rereading with cache and stale-result fences; external automatic detection/tracking/OCR replays plus repeated lifecycle/resource checks.

Local validation: 801 Node tests passed, zero failed/skipped; seven focused Python tests passed; syntax and whitespace checks passed. Transfer workflow verifies the patch SHA-256 and exact resulting tree, runs the full unit suite, removes itself and all transfer chunks, then performs only a non-force push to this follow-up branch.

PR66 was merged and its old branch deleted concurrently by another client. This follows the resulting master commit fc99ab1 whose tree is identical to our inspected production baseline. No master update or deployment is requested. Hosted new browser acceptance remains pending.
…GitHub actions

The source hash and all 801 tests passed in the first transfer run, but its contents-only token could not publish workflow changes. Retain that failed result. Validate the complete exact candidate as before, then publish only non-workflow changes with this token. The authorized connector will apply the two final test gates and remove this temporary helper in a separate commit. No token permission escalation, master write, merge or deployment.
Publish the workflow updates through the authorized connector and remove the temporary transfer helper. Final tree 86e86be matches the local candidate and the hosted transfer validation byte for byte. 801 Node tests, seven focused Python tests, syntax and whitespace checks passed; new real-browser acceptance still pending.

Includes all four requested additions: less preview painting and lazy live solver with bounded metrics; fresh-evidence-only callback fallback and bounded worker restart; proposal-only single-clue editor reread with explicit confirmation, caching and stale-reply rejection; real external-image automatic pipeline replays and repeated lifecycle/resource checks.

This follows master fc99ab1 because PR66 was merged and its branch removed concurrently. Keep the new work on improve/scanner-hardening-20260921. No merge or deployment.
@senegrom
senegrom marked this pull request as ready for review September 21, 2026 09:49
@senegrom
senegrom merged commit 55d4f18 into master Sep 21, 2026
13 of 14 checks passed
@senegrom
senegrom deleted the improve/scanner-hardening-20260921 branch September 21, 2026 09:50

Copy link
Copy Markdown
Owner Author

Final verification completed on resumption

The implementation and its checks are complete. The earlier description's pending-browser/draft status is now historical: GitHub shows this PR merged at 2026-09-21 09:50 UTC, and the post-merge deployment completed at 10:05 UTC, before this resumed verification. No source commit, merge, ref update or deployment was performed in this resumed pass.

Exact source and successful runs

Final PR head: 1119b6015d728e103d3e6e4ab2d1165091d42698.
Tested PR integration: c25bf0a0629d8fa6dd5626c1412782f0f708a129.
Merged master: 55d4f1860c62c37c468260eb3d0f162934742a5f.
The tested integration and merged commit both point to the same tree, f4ba1385218190d4315d224f0aa3d9fdc2eefe42.

All four final PR workflows passed:

Post-merge build, native/browser tests, independent acceptance and actual Pages deployment also passed: https://github.com/senegrom/GridPuzzle/actions/runs/35585463284 . The independent job verified the downloaded build and ran editor rereading and repeated-session tests in addition to the existing live-motion/recovery, review, preferences and diagnostic-privacy gates.

The downloaded final unit log records 801 tests passed, zero failed, cancelled or skipped. These are hosted results, not a new local-browser claim.

All four additions verified

  1. Preview work and measurements: duplicate visual states skip painting without skipping freshness validation. Live solver warm-up stays off with auto-solve disabled. Diagnostics retain bounded rendering/tracking timing windows, request/paint counts and first completed-reading timing. In the post-merge controlled 20-session fixture, Chromium performed 130 paints for 350 requests, WebKit 135 for 332. These are deduplication measurements, not comparisons of phone speed or battery life.
  2. Recovery: callback silence can switch to a fallback only with independently advancing frame evidence; a timer alone does not qualify. Tracking failures wait two/four seconds, pause after the third consecutive failure and offer explicit restart. Existing age and puzzle-identity checks remain unchanged.
  3. Editor rereading: both browser reports pass selected-cell-only proposals, no automatic field/puzzle mutation, identical-image cache reuse, explicit Use then Save, confirmed-cell protection, Undo restoring review, and rejection of late results after dialog dismissal or draft edits. The UI race tests use controlled OCR completions; real selected-cell OCR is covered by the separate recovery suites.
  4. Wider replay and lifecycle coverage: the fixed first three records of the existing hash-selected Lexski slice completed automatic detector/tracker/OCR reads in both browsers. Reference corners/values remained outside recognition. On scored unambiguous numeric entries:
Fixed source Chromium WebKit
images/6afxp9u0ke0d1.webp 42/44 43/44
images/mqec6cb3dm0d1.webp 36/36 34/36
images/zhudyie50d0d1.webp 49/50 50/50
Total 127/130 127/130

All six scored discrepancies were flagged. Ambiguous pencil/handwritten annotations are explicitly excluded from those numeric denominators and retained in the reports. This is new coverage, not an A/B accuracy gain or proof that every cell in these pictures was correctly understood. The external replay suite records coverage outcomes, not a blanket zero-error acceptance threshold.

Both browsers completed 20 repeated camera sessions. After every Stop, owned worker/timer counts, retained source/scratch images and active/queued tracking returned to zero; peak live tracking-worker count was one and live solver warm-up count was zero. Resolution changes and delayed actual worker deliveries are included. This checks owned-resource cleanup, not native heap/GPU allocation or physical-device thermal/battery behaviour.

The existing real moving-video test still reads 22/22 clues in one initial job without movement-induced cancellation. The degraded-to-clear recovery and changed-puzzle late-reply cases also pass in both the quality run and post-merge exact-artifact acceptance.

Raw artifacts downloaded and digest-verified

  • PR Scanner quality recognition-report, artifact 10631947959, SHA-256 0c2cef0f3b24dc3608932706219d531c783118004202a3ba6e926cd7e390f12b.
  • PR Scanner quality live-report, artifact 10631063722, SHA-256 773e41ccab980a533a232151199e8770a5cd94a492aa2938357a96a949074c9b.
  • Post-merge deployed-live-acceptance, artifact 10632876582, SHA-256 0ebb746346ef4a4db6c4045200454080e3b5dbfa2cba7101de3adae6e01aec62.

Raw reports and screenshots, rather than test counts alone, were inspected. Physical-iPhone responsiveness, memory, battery, autofocus and VoiceOver still need device testing. No neural OCR model, solver-derived clue substitution or relaxed identity checks are introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant