Skip to content

fix: pre-existing compiler V1 bugfixes (Lexer, Parser, RegAlloc, CodeGen, File)#128

Merged
egecanakincioglu merged 2 commits into
mainfrom
fix/pre-existing-compiler-bugs
Jun 6, 2026
Merged

fix: pre-existing compiler V1 bugfixes (Lexer, Parser, RegAlloc, CodeGen, File)#128
egecanakincioglu merged 2 commits into
mainfrom
fix/pre-existing-compiler-bugs

Conversation

@egecanakincioglu

Copy link
Copy Markdown
Owner

Atomic commit of pre-existing V1 bugfixes applied before SafeRegAlloc work.

Changes

  • Lexer.arm: POST_INC field no-op fix (this.pos++ was no-op causing infinite loop, 5.9GB RAM on 14-byte file)
  • Parser.arm: regex artifact fix (this.pos = pos + 1 → this.pos = this.pos + 1, parser state corruption)
  • RegAlloc.arm: spill save mechanism for linear scan register reassignment at instruction boundaries
  • X64Encoder.arm: unresolved label hard-fail (hasError flag set, prevents 0x400fff crash)
  • ELFWriter.arm: _start entry, argc/argv BSS globals (__arimo_argc, __arimo_argv), static binary fixes
  • CodeGen.arm: emitRelease memoization (54GB→3MB compile RSS), field access fixes
  • ScopeFrame.arm: borrow checker scope tracking fixes
  • TypeChecker.arm: type narrowing, method resolution, generic handling fixes
  • File.arm: File.exists fclose RAX corruption fix (fclose removed, return path corrected)

Verification

  • S1→S2 build PASS (63 modules, exit 0)
  • Single-file regression 9/9 PASS (old allocator path)

egecanakincioglu and others added 2 commits June 2, 2026 00:25
Release workflow fixes:
- Extend S1→S2→S3 chain (was S1→S2 only)
- Add S3==S4 determinism check
- Add static binary verification (file, ldd, readelf -l)
- Add packaged tar.gz validation step
- Release artifact: S3 (self-hosted, static) not S2 (bootstrap, dynamic)

CI test workflow:
- Add file type checking at each self-host stage
- Add S3 static verification step

Env stubs regression:
- Add test/env_stubs.arm: verifies Env.args(), Env.exePath(), Env.platform() do not SIGSEGV
- IRLower stubs already present (commit 2786639)

Self-host chain results:
- S2 (bootstrap-built): dynamic 266KB, full Env.args() support
- S3 (self-hosted): static 344KB, Env.args() stub → cannot compile S4
- S3→S4 determinism blocked on Env.args() startup ABI → V1.1

Root cause of v1.0 release dynamic binary:
- Release packaged S2 (bootstrap-built via gcc without -static)
- Should package S3 (self-hosted via arc native codegen)
- S3 is static but Env.args() stub blocks CLI usage → real argc/argv in V1.1

Co-Authored-By: Egecan Akıncıoğlu <dev@egecanakincioglu.com>
Lexer: POST_INC field no-op fix (this.pos++ was no-op causing infinite loop)
Parser: regex artifact fix (this.pos = pos + 1 → this.pos = this.pos + 1)
RegAlloc: spill save mechanism for linear scan register reassignment
X64Encoder: unresolved label hard-fail (hasError flag), prevents 0x400fff crash
ELFWriter: _start entry, argc/argv BSS globals, static binary fixes
CodeGen: emitRelease memoization (54GB→3MB compile RSS)
ScopeFrame: borrow checker scope tracking fixes
TypeChecker: type narrowing, method resolution fixes
File.arm: File.exists fclose RAX corruption fix (fclose removed, return path corrected)
@egecanakincioglu egecanakincioglu merged commit d811511 into main Jun 6, 2026
1 check passed
@egecanakincioglu egecanakincioglu deleted the fix/pre-existing-compiler-bugs branch June 6, 2026 01:39
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.

1 participant