From 2feaa1fb454c071d5335df332444a3cf9ee86564 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 5 Dec 2025 00:53:24 +0000 Subject: [PATCH] Bump version to v0.4.1 for bootstrap release - Updated version in pyproject.toml, __init__.py, README.md - Added CHANGELOG entry for v0.4.1 with bootstrap fixes - Updated ROADMAP.md to reflect full bootstrap achievement - Updated COMPILER_SELF_HOSTING.md status and conclusion - Updated bootstrap_test.sh comments to reflect v0.4.1 status --- CHANGELOG.md | 23 ++++++++++++++++ README.md | 2 +- ROADMAP.md | 8 +++--- docs/COMPILER_SELF_HOSTING.md | 51 ++++++++++++++++++++--------------- pyproject.toml | 2 +- scripts/bootstrap_test.sh | 19 +++++++------ src/eigenscript/__init__.py | 2 +- 7 files changed, 68 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca8bbe1..c5ff3a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.4.1] - 2025-12-05 + +### πŸŽ‰ Full Bootstrap Achieved! + +This release completes the bootstrap process - **Stage 1 and Stage 2 compilers now produce identical output**! The self-hosted compiler can fully compile itself. + +### Fixed + +#### Bootstrap Completion +- **External Variable Assignment**: Fixed codegen to properly handle assignment to external module variables (e.g., `parser_token_count`) +- **Runtime Pointer Detection**: Fixed `eigen_print_val` to handle low memory addresses in non-PIE executables +- **External Array Detection**: Modified `is_external_array` to require both module prefix AND array suffix, preventing false matches on local variables + +### Added + +- `is_known_external_scalar()` function to identify known external scalar variables from imported modules +- Improved documentation reflecting bootstrap success + +### Changed + +- Updated `SELF_HOSTING_QUICKSTART.md` to reflect successful bootstrap verification +- Bootstrap test script now shows Stage 1 and Stage 2 producing identical output + ## [0.4.0] - 2025-12-02 ### πŸŽ‰ Major Release: Self-Hosted Compiler diff --git a/README.md b/README.md index 209a168..bf1f184 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ EigenScript is a high-performance programming language where code is treated as a trajectory through semantic spacetime. It combines the **zero-cost abstractions** of a system language with the **geometric introspection** of a symbolic AI. ![Build Status](https://img.shields.io/badge/build-passing-brightgreen) -![Version](https://img.shields.io/badge/version-0.4.0-blue) +![Version](https://img.shields.io/badge/version-0.4.1-blue) ![Performance](https://img.shields.io/badge/speed-native-orange) ## πŸš€ Key Features diff --git a/ROADMAP.md b/ROADMAP.md index 3ea596e..e457a2a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,13 +1,13 @@ # EigenScript Roadmap πŸ—ΊοΈ -**Version:** v0.4.0 -**Last Updated:** 2025-12-02 +**Version:** v0.4.1 +**Last Updated:** 2025-12-05 ## Overview -EigenScript v0.4.0 marks a **historic milestone**: the language is now **self-hosting**! The EigenScript compiler, written entirely in EigenScript, can compile itself. This release also includes comprehensive AI/ML matrix operations, neural network activations, and full language feature support in the self-hosted compiler. +EigenScript v0.4.1 achieves **full bootstrap**: Stage 1 and Stage 2 compilers produce **identical output**! The self-hosted compiler can now fully compile itself, completing the bootstrapping process. This release also includes comprehensive AI/ML matrix operations, neural network activations, and full language feature support. -With 900+ passing tests and the self-hosting milestone achieved, the focus ahead is on **full bootstrapping**, additional language features, and ecosystem growth. +With 900+ passing tests and full bootstrap achieved, the focus ahead is on additional language features, optimization, and ecosystem growth. --- diff --git a/docs/COMPILER_SELF_HOSTING.md b/docs/COMPILER_SELF_HOSTING.md index 74a8e48..ba15e74 100644 --- a/docs/COMPILER_SELF_HOSTING.md +++ b/docs/COMPILER_SELF_HOSTING.md @@ -32,31 +32,38 @@ EigenScript has achieved two different types of self-hosting: - Compiles EigenScript to LLVM IR - Located in `src/eigenscript/compiler/selfhost/` -## Current Status (v0.4.0) +## Current Status (v0.4.1) + +### πŸŽ‰ Full Bootstrap Achieved! + +As of v0.4.1, the EigenScript compiler achieves **full bootstrap**: Stage 1 and Stage 2 compilers produce **identical output**! ### βœ… What Works -- **Reference Compiler Stage**: The Python-based reference compiler can successfully compile the self-hosted compiler +- **Reference Compiler Stage**: The Python-based reference compiler successfully compiles the self-hosted compiler - **Stage 1 Compiler**: The compiled self-hosted compiler can: - - Parse simple EigenScript programs + - Parse and compile complex EigenScript programs - Generate valid LLVM IR output - Link with the EigenScript runtime library -- **Module System**: All four compiler modules (lexer, parser, semantic, codegen) compile and link correctly + - **Compile itself to create Stage 2** +- **Stage 2 Compiler**: The self-compiled compiler: + - Produces identical output to Stage 1 + - Verifies the bootstrap is complete +- **Module System**: All five compiler modules (lexer, parser, semantic, codegen, main) compile, link, and run correctly -### ⚠️ Known Limitations +### βœ… Bootstrap Verification -- **Numeric Literal Bug** (Critical): Stage 1 compiler generates all numeric literals as zero. This is a systematic code generation bug in the reference compiler that affects how AST numeric values are handled. See "Troubleshooting" section for details. -- **Parser Limitation**: The parser cannot handle blank lines inside function bodies, which prevents the compiler from compiling itself (full bootstrap) -- **No Full Bootstrap**: Stage 1 cannot yet compile itself to produce Stage 2 due to the above limitations +``` +Stage 1 (eigensc) ──compiles──> Stage 2 (eigensc2) + β”‚ β”‚ + └──────── IDENTICAL OUTPUT β”€β”€β”€β”€β”€β”€β”˜ +``` ### 🎯 Future Goals -- **Fix Numeric Literal Bug**: Debug and fix the reference compiler's code generation for numeric literals in selfhost modules - - Root cause is in how list access patterns are compiled when variables are observed - - May require refactoring of the geometric tracking logic in `llvm_backend.py` -- Enhance parser to handle blank lines in function bodies -- Achieve full bootstrap (Stage 1 compiling itself) -- Verify Stage 1 and Stage 2 produce identical output +- Performance optimization of generated code +- Additional language feature support +- Improved error messages and diagnostics ## Architecture @@ -473,7 +480,7 @@ To achieve full bootstrap (Stage 1 compiling itself), the following issues need ### Related Documentation - [Meta-Circular Evaluator Guide](./meta_circular_evaluator.md) - Interpreter self-hosting -- [CHANGELOG.md](../CHANGELOG.md) - Release history with v0.4.0 details +- [CHANGELOG.md](../CHANGELOG.md) - Release history with v0.4.1 details - [Self-Hosting Roadmap](./self_hosting_roadmap.md) - Future plans ### Example Code @@ -572,17 +579,17 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md) for contribution guidelines. ## Conclusion -The EigenScript self-hosted compiler is a significant achievement demonstrating the language's maturity and capability. While full bootstrap is not yet achieved, the foundation is solid: +The EigenScript self-hosted compiler is a **landmark achievement** demonstrating the language's maturity and capability. **Full bootstrap has been achieved**: - βœ… All compiler modules compile successfully - βœ… Stage 1 compiler runs and generates valid LLVM IR -- ⚠️ Some runtime bugs need fixing -- 🎯 Full bootstrap is within reach +- βœ… Stage 1 compiles itself to create Stage 2 +- βœ… Stage 1 and Stage 2 produce **identical output** -This work represents ~5700 lines of EigenScript code implementing a complete compilation pipeline from source code to LLVM IR. It proves that EigenScript is a practical, powerful language capable of implementing complex systems. +This work represents ~5700 lines of EigenScript code implementing a complete compilation pipeline from source code to LLVM IR. EigenScript joins the ranks of languages capable of compiling themselves - a rare and significant milestone in programming language development. --- -**Version**: 0.4.0 -**Last Updated**: December 2025 -**Status**: Partial Bootstrap Achieved +**Version**: 0.4.1 +**Last Updated**: December 2025 +**Status**: Full Bootstrap Achieved diff --git a/pyproject.toml b/pyproject.toml index d8defa4..6c68245 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "eigenscript" -version = "0.4.0" +version = "0.4.1" description = "A high-performance geometric programming language with native compilation" readme = "README.md" requires-python = ">=3.10" diff --git a/scripts/bootstrap_test.sh b/scripts/bootstrap_test.sh index 1f8d633..cb66f89 100755 --- a/scripts/bootstrap_test.sh +++ b/scripts/bootstrap_test.sh @@ -8,23 +8,22 @@ # 3. Stage 1 compiler compiles itself -> eigensc2 (stage 2) # 4. Compare stage 1 and stage 2 outputs (should be identical) # -# Current Status (v0.4.0): +# Current Status (v0.4.1): # - lexer.eigs: COMPILES βœ“ # - parser.eigs: COMPILES βœ“ # - semantic.eigs: COMPILES βœ“ -# - codegen.eigs: COMPILES βœ“ (fixed type inference, uses lexer_get_string) +# - codegen.eigs: COMPILES βœ“ # - main.eigs: COMPILES βœ“ # - LINKING: SUCCESS βœ“ -> eigensc binary created # - RUNTIME: WORKING βœ“ - stage 1 compiler generates valid, executable LLVM IR -# - Module init calls now working (parser/lexer globals initialized) -# - String printing now works (STRING_PTR handling added) -# - EigenValue pointer initialization fix (conditional branch handling) -# - Simple programs compile and run correctly! -# - BOOTSTRAP: PARTIAL - stage 1 can compile simple programs -# - Parser limitation: blank lines inside function bodies not supported -# - main.eigs cannot be parsed yet due to blank line issue in parser.eigs +# - BOOTSTRAP: COMPLETE βœ“ - Stage 1 and Stage 2 produce IDENTICAL output! # -# Fixes applied: +# Key fixes for bootstrap (v0.4.1): +# - External variable assignment in codegen (parser_token_count, etc.) +# - Runtime pointer detection for low memory addresses (non-PIE) +# - External array detection with proper prefix/suffix matching +# +# Historical fixes applied: # - Reference compiler type inference for variable reassignment # - escape_string builtin handling in reference compiler # - Cross-module function calls via mangled names (lexer_get_string) diff --git a/src/eigenscript/__init__.py b/src/eigenscript/__init__.py index ae863d9..e429f1b 100644 --- a/src/eigenscript/__init__.py +++ b/src/eigenscript/__init__.py @@ -5,7 +5,7 @@ This package contains the core interpreter and runtime for EigenScript. """ -__version__ = "0.4.0" +__version__ = "0.4.1" __author__ = "J. McReynolds" from eigenscript.lexer import Tokenizer, Token, TokenType