🚀 Major LLVM breakthrough by ChatGPT5\!

PHI type coercion and core-first routing fixes:
- Auto type conversion for PHI nodes (i64↔i8*↔i1↔f64)
- Fixed ArrayBox.get misrouting to Map path
- Core-first strategy for Array/Map creation
- Added comprehensive debug logging ([PHI], [ARR], [MAP])

Results:
 Array smoke test: 'Result: 3'
 Map smoke test: 'Map: v=42, size=1'

After 34+ minutes of battling Rust lifetime errors,
ChatGPT5 achieved a major breakthrough\!

Key insight: The bug wasn't in PHI/SSA logic but in
Box type routing - ArrayBox.get was incorrectly caught
by Map fallback due to missing annotations.

We're SO CLOSE to Nyash self-hosting paradise\! 🌟
Once this stabilizes, everything can be written in
simple, beautiful Nyash code instead of Rust complexity.
This commit is contained in:
Selfhosting Dev
2025-09-12 12:07:07 +09:00
parent 1f5ba5f829
commit 4fe1212d36
9 changed files with 203 additions and 14 deletions

View File

@ -58,13 +58,13 @@ pub(in super::super) fn lower_boxcall<'ctx>(
return Ok(());
}
// Delegate Array methods
if super::arrays::try_handle_array_method(codegen, func, vmap, dst, box_val, method, args, recv_h)? {
// Delegate Map methods first (to avoid Array fallback catching get/set ambiguously)
if super::maps::try_handle_map_method(codegen, func, vmap, dst, box_val, method, args, recv_h)? {
return Ok(());
}
// Delegate Map methods
if super::maps::try_handle_map_method(codegen, func, vmap, dst, box_val, method, args, recv_h)? {
// Delegate Array methods
if super::arrays::try_handle_array_method(codegen, func, vmap, dst, box_val, method, args, recv_h)? {
return Ok(());
}