Skip to content

fix(compiler): fail closed at effect analysis limits - #3447

Closed
adilalperenciftci wants to merge 1 commit into
aether-lang-dev:mainfrom
adilalperenciftci:fix/effect-tags-analysis-limits
Closed

adilalperenciftci wants to merge 1 commit into
aether-lang-dev:mainfrom
adilalperenciftci:fix/effect-tags-analysis-limits

Conversation

@adilalperenciftci

Copy link
Copy Markdown
Contributor

Summary

I traced a fail-open path in effect-tag validation to the checker's bounded call-graph walk. Once recursion exceeded 128 levels, or the visited set reached 512 functions, the unexamined path was treated as capability-free and the annotated function could compile.

This change:

  1. records incomplete analysis when either bound is reached;
  2. rejects the tagged function with an explicit analysis-limit diagnostic unless a more specific forbidden-capability diagnostic was already found;
  3. counts only resolved Aether callees against the visited-function bound;
  4. adds generated depth and width regressions for both limits.

Verification

  • BEFORE: both bounded-analysis regressions compiled.
  • AFTER: both are rejected with the analysis-limit diagnostic.
  • sh tests/integration/effect_tag_limits/test_effect_tag_limits.sh
  • sh tests/integration/effect_tags/test_effect_tags.sh
  • sh tests/integration/aetherc_emit_effects/test_aetherc_emit_effects.sh
  • make check-changelog
  • make check-tests
  • make test (634 passed)

Signed-off-by: Adil Alperen Çiftci adilalperenciftci@users.noreply.github.com

Copilot AI balanced review requested due to automatic review settings October 29, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
@adilalperenciftci
adilalperenciftci force-pushed the fix/effect-tags-analysis-limits branch from 31a5211 to 1cd2956 Compare October 29, 2026 17:13
@adilalperenciftci

Copy link
Copy Markdown
Contributor Author

Rebased onto current main at 356bfd8e and resolved the typechecker conflict by retaining multi-clause effect scanning while carrying the fail-closed depth/visited-set state across every clause.

Ubuntu VM verification:

  • effect_tag_limits: depth and visited-function limits rejected as expected.
  • effect_tags: direct, transitive, and multi-clause violations rejected.
  • make check-tests: passed.
  • make check-changelog: passed.
  • make test: 634 passed, 0 failed.

Updated head: 1cd29563.

@paul-hammant

Copy link
Copy Markdown
Collaborator

Thanks @adilalperenciftci! This landed in #3474, which batched nine of your PRs and merged on 2026-10-30 (ca1dae7d). Your commit went in unchanged with your authorship, so this PR is superseded, and I'm closing it.

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.

4 participants