Skip to content

fix: make result extrema scale safe - #98

Open
petergstfsn wants to merge 1 commit into
mainfrom
codex/scale-safe-result-extrema
Open

fix: make result extrema scale safe#98
petergstfsn wants to merge 1 commit into
mainfrom
codex/scale-safe-result-extrema

Conversation

@petergstfsn

Copy link
Copy Markdown
Contributor

Summary

  • add a shared finiteExtrema reduction for ordinary arrays, sparse arrays, typed arrays, and projected values without input copies or argument spreading
  • migrate unbounded result-field extrema in Core result assembly, solver diagnostics, static envelopes, imported/derived fields, transient ranges, and result UI paths
  • add supported-scale regression coverage for displacement, stress, reaction, imported fields, element-sized arrays, empty fields, and nonfinite values
  • make BROWSER_SOLVE_LIMITS the explicit product-limit authority and distinguish the approximately 100k validation benchmark from the guarded 150k-DOF ceiling
  • make STEP meshing's quadratic fallback derive its node guard from the authoritative browser limit instead of a stale hardcoded 100k-DOF value

Public contracts and review flags

  • @opencae/core now exports finiteExtrema and FiniteExtrema.
  • The helper ignores NaN and both infinities, returns null for empty/all-nonfinite inputs, and treats ordinary/sparse/typed arrays consistently. Existing result-field fallbacks retain a finite 0..0 range for empty fields.
  • The browser product ceiling remains 150,000 DOF; this PR does not raise it. The mesh-intake preflight now observes that existing authority instead of imposing a separate 100,000-DOF limit.
  • Result legend midpoint labels now use the finite range midpoint instead of allocating and sorting a full result array for its median. Units and label/result shapes are unchanged.
  • @opencae/mesh-intake gains one existing workspace dependency on the lightweight @opencae/solve-pipeline/limits entry point. No third-party dependency was added.

Verification

  • pnpm install --frozen-lockfile — passed
  • git diff --check — passed; the repository has no formatter command or root lint job
  • pnpm --filter "./packages/*" --if-present lint — passed (the five package lint scripts are typecheck aliases)
  • documented package builds — passed
  • pnpm --filter "./packages/*" --if-present test — passed: 259 tests
  • node scripts/verify-cloudflare-config.mjs — passed
  • pnpm typecheck — passed
  • focused scale/result suite — passed: 160 tests
  • pnpm test — passed: 153 files, 1,590 tests
  • pnpm verify:step-selection-browser — passed in real Chrome for 1 mm, 25 mm, and 500 mm fixtures; detailed/balanced face IDs and fingerprints matched with no console or page errors
  • pnpm build:cloudflare — passed
  • pnpm --filter @opencae/web check:bundle — passed: initial JS 63,822/179,200 bytes gzip; total JS 1,343,404/1,536,000; largest lazy gzip 141,618/307,200; largest lazy raw 445,787/512,000; precache 24,580,590/27,262,976
  • pnpm verify:perf — passed its production build and local HTTP/startup checks (402 ms startup); its optional Playwright browser probe was not configured and was skipped
  • node scripts/verify-100k-solve.mjs — attempted with host Chrome access, but timed out waiting for the Chrome solve-benchmark result after approximately nine minutes; the serial WebKit leg did not start. This run supplies no new cross-browser or 150k performance certification.

Assumptions

  • BROWSER_SOLVE_LIMITS is authoritative because current production preflight and worker orchestration import it, and no contrary code authority was found.
  • Small fixed-size vectors and bounded collections remain on spread-based reductions where the argument-count failure cannot occur and the expression remains clearer.
  • Nonfinite result samples remain present for validation/diagnostics; only extrema calculation ignores them.

No deployment, production service, migration, secret, or infrastructure operation was performed.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
opencae eb0b12d Aug 28 2026, 07:27 PM

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