summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-10-12 16:46:53 -0700
committerCliff Click <cliffc@acm.org>2026-10-12 16:46:53 -0700
commit0e94cdc0c481e9312d1b5033b3597c7c262ff878 (patch)
tree2d77b8aa47dc406407ce7ccfe95b415a68016342 /docs
parent1213e8e8f359c8a1abb05ee8a220d9c56bc36051 (diff)
downloadSimple-0e94cdc0c481e9312d1b5033b3597c7c262ff878.tar.gz
Simple-0e94cdc0c481e9312d1b5033b3597c7c262ff878.zip
Check for cyclic class init before we emit codeclinit
Diffstat (limited to 'docs')
-rw-r--r--docs/chapter-backports.md19
1 files changed, 18 insertions, 1 deletions
diff --git a/docs/chapter-backports.md b/docs/chapter-backports.md
index 5b9df53a..6b4462eb 100644
--- a/docs/chapter-backports.md
+++ b/docs/chapter-backports.md
@@ -576,7 +576,7 @@ choose CompUnit dependency edges and function may-touch summaries for cycle
checking, separately from ordinary alias-memory facts for runtime `$init`.
No separate ClassInit object or analysis-only memory slice is planned initially.
-**Checkpoint 1 revised for review (2026-10-10):** initialization cycles now
+**Checkpoint 1 reviewed (2026-10-10):** initialization cycles now
count only requirements surviving Opto. Parser inserts ideal CLInit obligations
on control; the collector walks optimized function bodies and propagates their
final call-target effects into CompUnit dependencies. Removed branches/targets
@@ -607,6 +607,23 @@ log: `build/inline-never-exit.log`.
Changing data-pointer width and moving fully initialized class objects to
read-only storage remain separate follow-ons.
+**Checkpoint 2 implemented for review (2026-10-10):** each class initializer's
+object has a normal mutable boolean `$init` field with a zero initial image.
+The C0DE header now carries owned units, initialization edges, completeness/static
+flags, and function effect summaries. Ideal CLInit markers survive serialization;
+backend erasure happens afterward. Loading remaps identities and validates the
+combined graph, including imported initializers without live bodies. Object
+discovery distinguishes definitions from referenced class names, and serialized
+IR excludes imported bodies. Focused fixtures cover cross-object cycles, shared
+diamond identities, interleaving module orders, imported helper inlining, and
+flag layout/remapping. Runtime check/call/store lowering remains checkpoint 3;
+rebuild old objects after the format change. All 494 Chapter 25 Make tests pass.
+Diagnostic witnesses use compact `ClassCyclicError` records with numeric locations
+and shared call-chain suffixes, including across serialization. Strings are
+formatted only on rejection. Validation includes source call-chain and imported
+field locations. Logs: `build/init-checkpoint2-*.log` and
+`build/class-cycle-witness-all.log`.
+
The original broader design below remains a proposal, not a completion claim.
The goal is to pre-allocate AOT class objects in ELF data and pre-fill their