Skip to content

FPFNFIXAPEX: respect finite async countdown iterations - #2203

Draft
aidenybai wants to merge 2 commits into
fix/async-while-cancellation-flowfrom
fix/finite-async-countdown-cancellation
Draft

aidenybai wants to merge 2 commits into
fix/async-while-cancellation-flowfrom
fix/finite-async-countdown-cancellation

Conversation

@aidenybai

@aidenybai aidenybai commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Why

The generic while analysis treated zero and single countdowns as if another iteration could run, and trusted a cancellation check after repeated iterations reset its flag. The bounded countdown proof handles the supported loop exactly.

The review also found that each sibling helper rescanned the entire Effect. Cache the pure result for the actual scope analysis, Program and Effect identity so repeated queries reuse that scan.

What changed

  • Recognize owned integer countdowns from 0 to 8 with closed counter references and the supported three-statement body: a state/reset write, a zero-argument awaited call and a decrement.
  • Keep the existing direct-call, constant async helper and guard restrictions. Ref, sequence, deferred and unsupported counter cases keep their prior behavior.
  • Reuse Effect facts across countdown queries without changing the recognition predicate or mutating the AST.
  • Add focused growth and cache invalidation controls alongside the existing regression tests and patch changeset. Stacked on FPFNFIXAPEX: preserve scalar cancellation guards across while iterations #2202.

Test plan

  • Focused cache/countdown controls: 62 passed; package typecheck passed.
  • 513 old/new full diagnostic comparisons preserve results and AST properties and references. Previously documented eval, additional-writer, timer-only and unreachable-setter controls retain their original results; this repair receives no fix credit for them.
  • Full seven-package suite: 35,714 passed, 1,119 skipped.
  • All package typechecks, lint, format, registry, published-dependency checks and JSON schema smoke passed. Fresh build: five successful tasks, no cache hits; 175 own runtime artifacts and five package edges verified.
  • Strict fuzzing: 500 iterations, seed 42; 2,169 executions, 236 target firings, no findings.
  • Native helper work for 32 to 128 sibling helpers drops from the original 30,784–491,776 visits to 962–3,842. Broader inherited quadratic work remains documented. Operation counts do not establish wall-time or CPU performance.
  • Deduplication and normal commit hooks passed without a staged warning. All five natural checks/statuses passed on the pushed repair.

This PR remains draft pending integration of the updated ancestor fixes, final composed-source checks, public performance profiles and remote parity. Earlier performance flags remain unresolved.

@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@2203
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@2203
npm i https://pkg.pr.new/react-doctor@2203

commit: 3cff5da

This branch has not been deployed

No deployments
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