Skip to content

app: reject oversized scroll deltas before integer conversion - #3470

Merged
ashhart merged 2 commits into
ashhart:mainfrom
AIflow-Labs:aiflow/fix-scroll-delta-overflow
Nov 18, 2026
Merged

ashhart merged 2 commits into
ashhart:mainfrom
AIflow-Labs:aiflow/fix-scroll-delta-overflow

Conversation

@AIFlowML

@AIFlowML AIFlowML commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

A scroll request with a large finite delta, such as dx: 1e100, currently traps the native computer helper while converting the value to Int. The parser now checks the rounded floating-point value against its existing ±200-line limit before converting it, so these requests return bad_request and the helper stays alive. Valid values keep their existing rounding and limits.

  • Issue: n/a; newly reproduced app-helper parser defect found while checking the Swift parser. All-state issue/PR searches for scroll delta, overflow and helper crashes found no matching fix. This changes request validation, with no engine/model/backend arithmetic change.
  • Stacked on: main, base e7e24243d63e232b05d4892df4fa01c9a2d6c70b; 1 contribution commit.
  • atc overlap --json: run after the final revision; broad coverage is explicitly incomplete (PR/file/time limits). Supplemental coverage at 2026-11-16T09:22:11.895781+00:00 inspected all 416 open PRs, with complete file pagination and previous filenames for 37 large/renamed PRs. Real merge checks against current main, the other 13 contribution heads and overlapping external fix(studio): open the model picker from Planning only #3357, app: pin nested repositories and refuse unprotected worktrees in the Linux sandbox #3364 and fix(app): don't open a blank Thread view for a missing ticket thread #3393 all pass (238/238 checks across this portfolio). Our own cumulative composition passes 36/36 focused files. No known conflicts; future upstream changes require a fresh check.

Checks on this head

Verified 16 November 2026, 16:25 Asia/Bangkok. Base for this PR: e7e24243d63e232b05d4892df4fa01c9a2d6c70b. The current rebase has the byte-identical complete app tree of previously published 8795bf204a37dab025abdcc20f060931fa7d675b (162f609c8ddf00f29fc4c9ccc8539591a2982799). Earlier full-suite/build/mobile receipts below remain tied to their recorded measured revisions; focused tests, types, formatting and preflight were repeated on this head. Our 14 contribution branches also pass 36/36 focused test files in a cumulative composition. This is a focused compatibility run, not a full combined-suite result.

  • Head commit: 1cf7fbebac2c05ca5ff39fa8d0ae9c92a416bbe6.
  • Lean checker on base/head: 337/337 inherited findings; zero new findings. python3 tools/pr_check.py --base e7e24243d63e232b05d4892df4fa01c9a2d6c70b: zero errors, 0 warnings.
  • Tests run, with the command and pass, fail and skip counts:
    • node scripts/computer-request-parser.test.mjs: 1/1 file passes on macOS, no skips. It compiles the actual production parser into a parse-only probe; no computer input is executed. On the original source, the first dx: 1e100 case terminates with SIGTRAP and the test exits nonzero. On the fix, both axes reject huge positive/negative finite values, Int.min, out-of-bounds rounding, booleans and strings with a single JSON error reply. Positive controls cover ±200, rounding, a missing axis and zero rejection.
    • node scripts/build-computer-helper.mjs: native arm64 helper builds; 248/248 self-checks pass. The full runner's private-data scan passes.
    • Combined with app: test computer-use parsing on Linux with Swift Testing #3465: the same production-parser regression passes in the shared source layout, and swift test --package-path app/native/computer-use/ComputerUseChecks passes 6/6 tests. A pinned Swift 6.2.3 Linux ARM64 parse-only probe rejects 10 oversized deltas and accepts two valid controls without crashing.
    • npm test: 855/856 files pass, one inherited failure, no runner skips. electron/agent/sandbox-git-control.test.ts fails git commit still works, also reproduced on unchanged upstream. No sandbox code or test changed.
    • npm run typecheck, npm run build, npm run verify:mobile, git diff --check and zig fmt --check build.zig zig: pass.
    • Full-suite/native receipts were measured on 5fff2d38d26c1aa505e2b6efab8cc7ce0bdd2474; the final rebase has a byte-identical app tree. The focused regression, types/build/mobile and PR checker were repeated on the head above. Composition receipts use that original app tree plus app: test computer-use parsing on Linux with Swift Testing #3465 head ce68d85fa67e8261a36400ae1a1d04a048e1ab67.
  • CI: Zig format: success; App and mobile checks: success; No GPU: success. All 12 applicable upstream checks passed on this head. The two scheduled nightly jobs were skipped.
  • Not run, and why: packaged Electron and actual scroll-input dispatch were not run; the changed behavior is parser rejection and the test intentionally performs no computer input. Windows and Linux desktop integration were not run. Linux coverage uses the shared-source composition with app: test computer-use parsing on Linux with Swift Testing #3465, not the legacy macOS-only layout.

Receipt

  • Main against branch: n/a; native computer-request parsing cannot reach model inference.
  • Boxes it reaches: scroll request validation in the native computer helper.
  • New switch? Default, accepted values, profile row: n/a; none added.
  • Environment, with the TensorFold commit, Zig and backend toolchain, machine and GPU, checkpoint and revision: base d2b37227a8b4431a71d87bf093786aadcfa35b62, head above; Apple M5 Max, 128 GB, macOS 27.2, Swift 6.4.2, Node 22.23.3/npm 10.9.8. Linux ARM64 uses official Swift 6.2.3 Noble image pinned at sha256:6dd90eb2359663a2cde8f03e9951f488b23134b3b8fce20e9dcb6cada75dd803. Zig 0.17.0 for the formatter; backend/checkpoint n/a.
  • Paths and platforms the change reaches, which I ran and which I could not: macOS arm64 parser and helper self-tests; Linux ARM64 shared-parser probe in combination with app: test computer-use parsing on Linux with Swift Testing #3465. No other chip or desktop platform qualification claimed.
  • Exactness, from tools/bench_concurrent.py --alone --serial or token_sha against "draft": false: n/a; no inference change.
  • Main against this branch, same machine and checkpoint, posted before asking for a run on our machines (or why you can't): n/a; no model run needed or requested.
  • Decode speed before and after, from tools/bench_openai.py: n/a; no inference change.
  • Prompt speed before and after: n/a; no prompt-processing change.
  • Licence of any new weights or drafter, or "n/a": n/a; none added.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency. The parser test skips when Swift or a supported production source layout is unavailable; compiler and probe processes have explicit timeouts.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

Igor Lessio - AIFLOW LABS

@AIFlowML
AIFlowML force-pushed the aiflow/fix-scroll-delta-overflow branch from 8795bf2 to 1cf7fbe Compare November 16, 2026 09:23
@AIFlowML
AIFlowML marked this pull request as ready for review November 16, 2026 09:27
@ashhart

ashhart commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Thanks @AIFlowML. Rounding first and checking against the 200-line limit before converting to Int turns a huge finite delta into bad_request instead of a crash, with the same rounding and limits as before. The new parser test sends dx: 1e100 through the real parser, and CI is green.

Nothing more is needed from you. It's in our landing queue.

  • Synthena

@ashhart
ashhart force-pushed the aiflow/fix-scroll-delta-overflow branch from 1cf7fbe to d2b5095 Compare November 18, 2026 17:04
@ashhart
ashhart merged commit f60dcf8 into ashhart:main Nov 18, 2026
@ashhart

ashhart commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Thank you @AIFlowML. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

joshuaswarren pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 19, 2026
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.

2 participants