Skip to content

fix(compiler): bound nesting with positioned resource diagnostics - #73

Merged
AetherAI3 merged 3 commits into
mainfrom
codex/compiler-resource-limits
Nov 1, 2026
Merged

AetherAI3 merged 3 commits into
mainfrom
codex/compiler-resource-limits

Conversation

@AetherAI3

@AetherAI3 AetherAI3 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Why does this change belong in Nano?

The 100-parenthesis source in #64 exhausted Python's stack in compilation and editor diagnostics. Flat operator chains could also produce unsafe trees for recursive compiler passes.

What changed?

Source entrypoints now enforce deterministic syntax-scope and expression-depth limits of 32 before downstream recursion. Unary runs parse iteratively. NanoResourceLimitError preserves the offending source position and exposes stable RESOURCE_LIMIT, resource, and limit fields. Trusted hosts can lower the frozen CompilerLimits ceiling explicitly; raising it is rejected.

Source bytes, token count, and total emitted nodes remain unbudgeted in this focused fix. Counting rules, host configuration, limits of the policy, and reproducible depth-boundary timing/memory measurements are documented in docs/compiler-limits.md. There is no global worst-case performance claim for unlimited source width.

Validation

  • 59 focused limit tests: exact/one-over parentheses, unary operators, nested conditionals, boolean/arithmetic chains, calls/index/member chains, lower host ceilings, original reproducer, 10,000-level adversaries, and CLI/editor position/message agreement.
  • 446 existing compiler/types/library/editor/conformance compatibility tests.
  • Fuzz campaign: 256 generated cases under all five default hash seeds; 30 additional resource fixtures / 156 adapter checks per worker; zero defects and stable corpus/semantic digests.
  • python scripts/check_contribution.py --all: 55 entries ready for review.
  • Independent review: 61 mixed boundary probes (41 admitted, 20 positioned resource rejections), no unexpected exceptions; dependency chains through 2,000 bindings compile.
  • Wheel built with isolated setuptools 78.1.0 backend and compiler/catalog imported from the wheel outside the checkout. Local pip frontend had certificate/distutils environment issues; direct backend build succeeded.
  • Parse benchmark on CPython 3.11.9 / Windows, recursion limit 1000: 25 repetitions of maximum-depth fixtures and 256 bindings at depth 32; measured results and exact script published.
  • Final frozen-tree full reference suite at 643cf5f: 1510 passed, 7 skipped on Python 3.11.9 (300.47s).
  • Hosted CI: jobs could not start. GitHub check annotations report: "The job was not started because your account is locked due to a billing issue." No test step ran; this is not a passing CI result.

Python 3.13 could not run locally because the WindowsApps launcher is access-denied; the repository CI matrix covers Python 3.10–3.13.

Boundary check

  • Preserves deterministic semantics and canonical IR for admitted corpus programs.
  • No recursion-limit mutation and no blanket conversion of internal exceptions.
  • No provider, model, hardware, or external actuation.
  • Does not bypass the host-owned DecisionGate.

Fixes #64. Review/merge remains manual under roadmap #67; an open PR is not issue closure.

Verified integration disposition

This exact source head 643cf5f698c5f95609bc84374e055dd2b8656c68 is an ancestor of actual integration commit cb6ea884d63dcaa8cc0e7c0b952bb88784e8219f, delivered by #82 to main. The source is included; no duplicate patch or separate source-PR merge is needed.

The human explicitly authorized the three integration PRs Nano82/ATLAS188/Predator460 to use reviewed passing LOCAL evidence in place of the earlier self-hosted gate. The waiver is recorded verbatim in those merged integration PR bodies; it is not a passing CI claim or a separate waiver-based admin merge of this source PR. Cloud41322926091 remains FAILED STARTUP with zero jobs/check runs. Local source pins, commands, counts, skips, review limitations, merged trees and actual target branches are recorded there and in the captain evidence bundle.

This source PR is retired as included/superseded by that actual integration. Issue #61 remains open for incomplete service-wire acceptance; other issue closure requires its own acceptance audit. Branches are preserved. No formal GitHub approval, production activation, runner/security/credential change or provider execution occurred.

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.

[P1] Bound compiler nesting and return stable resource-limit diagnostics

1 participant