Skip to content

feat(#5165): add @Impure and annotate impure atoms#5245

Draft
asmirnov-backend wants to merge 2 commits into
objectionary:masterfrom
asmirnov-backend:5165-impure-annotation
Draft

feat(#5165): add @Impure and annotate impure atoms#5245
asmirnov-backend wants to merge 2 commits into
objectionary:masterfrom
asmirnov-backend:5165-impure-annotation

Conversation

@asmirnov-backend

@asmirnov-backend asmirnov-backend commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Part of #5165.

  1. Adds the @Impure marker annotation — it flags atoms whose result depends on the outside world or mutable state.
  2. Annotates the 20 such atoms so the upcoming PhSticky caching decorator never memoizes them:
    • filesystem — all EOfs/* (file.*, dir.*);
    • OS — EOsm: os.name, posix.φ, win32.φ;
    • shared memory — EOmalloc* (read/write/resized/size/of.φ, all via Heaps.INSTANCE).

Pure atoms (arithmetic, math, regex/sprintf/sscanf, error/try) are left un-annotated so they remain cacheable.

Marks atoms whose result depends on the outside world so caching
decorators like `PhSticky` never memoize them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@asmirnov-backend
asmirnov-backend force-pushed the 5165-impure-annotation branch from 519f300 to 052b7f4 Compare June 19, 2026 15:49
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🚀 Performance Analysis

All benchmarks are within the acceptable range. No critical degradation detected (threshold is 100%). Please refer to the detailed report for more information.

Click to see the detailed report
Test Base Score PR Score Change % Change Unit Mode
benchmarks.XmirBench.xmirToEO 13085.201 12658.735 -426.467 -3.26% ms/op Average Time

✅ Performance gain: benchmarks.XmirBench.xmirToEO is faster by 426.467 ms/op (3.26%)

Mark the 20 atoms whose result depends on the outside world or mutable
state: filesystem (`EOfs`), OS (`EOsm`: os.name, posix, win32) and shared
memory (`EOmalloc`). `PhSticky` must never memoize these.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@asmirnov-backend asmirnov-backend changed the title feat(#5165): add @Impure marker annotation feat(#5165): add @Impure and annotate impure atoms Jun 19, 2026
@sonarqubecloud

Copy link
Copy Markdown

@asmirnov-backend

Copy link
Copy Markdown
Contributor Author

@yegor256, could you please take a look

@yegor256

Copy link
Copy Markdown
Member

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