|
|
1730fea206
|
docs: Add comprehensive modularization implementation plan
Create 5-document modularization strategy for 3 large source files:
- control_flow.rs (1,632 lines → 19 modules)
- generic_case_a.rs (1,056 lines → 7 modules)
- loopform_builder.rs (1,166 lines → 11 modules)
Documents included:
1. **README.md** (352 lines)
Navigation hub with overview, metrics, timeline, ROI analysis
2. **modularization-implementation-plan.md** (960 lines)
Complete 20-hour implementation guide with:
- Phase-by-phase breakdown (13 phases across 3 files)
- Hour-by-hour effort estimates
- Risk assessment matrices
- Success criteria (quantitative & qualitative)
- Public API changes (zero breaking changes)
3. **modularization-quick-start.md** (253 lines)
Actionable checklist with:
- Copy-paste verification commands
- Emergency rollback procedures
- Timeline and milestones
4. **modularization-directory-structure.md** (426 lines)
Visual guide with:
- Before/after directory trees
- File size metrics
- Import path examples
- Code quality comparison
5. **phase4-merge-function-breakdown.md** (789 lines)
Detailed implementation for most complex phase:
- 714-line merge_joinir_mir_blocks() → 6 focused modules
- 10 detailed implementation steps
- Common pitfalls and solutions
Key metrics:
- Total effort: 20 hours (2-3 weeks)
- Files: 9 → 37 focused modules
- Largest file: 1,632 → 180 lines (-89%)
- Backward compatible: Zero breaking changes
- ROI: Breakeven in 4 months (5 hrs/month saved)
Priority: control_flow.rs Phase 1-4 (high impact)
Safety: Fully reversible at each phase
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-12-05 20:13:31 +09:00 |
|
|
|
3af98964ed
|
feat(joinir): Phase P2-P4 Loop Pattern boxification
- P2: Create loop_patterns/ module structure
- common.rs: shared helpers (ParsedProgram, LoopContext, etc.)
- simple.rs: generic loop lowering
- filter.rs, print_tokens.rs: delegate to simple
- break_pattern.rs, continue_pattern.rs: new modules
- P3: Create LoopFrontendBinding layer
- Separate function name detection from pattern lowering
- detect_loop_pattern() for pattern classification
- P4: Break/Continue pattern migration
- Move Break/Continue handling from loop_patterns_old.rs
- Add LoopPattern::Break and LoopPattern::Continue variants
- Design: 3-layer architecture
- LoopFrontendBinding: function name → LoopPattern
- loop_patterns: LoopPattern → JoinIR
- Bridge/VM: Box semantics
All 56 JoinIR tests pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-11-29 09:04:18 +09:00 |
|
|
|
fd83903f87
|
feat(joinir): Phase P1 If Handler boxification - 40% code reduction
## Summary
Refactored loop-internal If statement handling into a boxified module
structure, achieving 154-line reduction (40%) from stmt_handlers.rs
with zero regression.
## Implementation
- Created if_in_loop/ module (9 files, ~480 lines)
- pattern.rs: IfInLoopPattern enum (5 variants)
- lowering/{empty,single_var_then,single_var_both,conditional_effect,unsupported}.rs
- Replaced lower_if_stmt_in_loop() (154 lines) with lower_if_stmt_in_loop_boxified()
- Made StatementEffect pub(crate) for module visibility
## Pattern Classification
1. Empty: condition-only check (no side effects)
2. SingleVarThen: if { x = a } → x = cond ? a : x
3. SingleVarBoth: if { x = a } else { x = b } → x = cond ? a : b
4. ConditionalEffect: if pred(v) { acc.push(v) } (filter pattern)
5. Unsupported: complex cases (Phase 54+)
## Test Results
✅ 56 JoinIR tests PASSED (0 failed, 0 regression)
✅ Build successful (1m 02s)
✅ Improved maintainability (easier to add new patterns)
## Files Changed
- src/mir/join_ir/frontend/ast_lowerer/
- if_in_loop/ (9 new files)
- mod.rs (+2 lines: module + pub use)
- stmt_handlers.rs (-154 lines: 40% reduction)
- CURRENT_TASK.md (+5 lines: Phase P1 記録)
- docs/development/refactoring/p1-if-handler-boxification-plan.md (new)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-11-29 07:20:56 +09:00 |
|
|
|
51ff558904
|
feat(phase32): L-2.1 Stage-1 UsingResolver JoinIR integration + cleanup
Phase 32 L-2.1 complete implementation:
1. Stage-1 UsingResolver main line JoinIR connection
- CFG-based LoopForm construction for resolve_for_source/5
- LoopToJoinLowerer integration with handwritten fallback
- JSON snapshot tests 6/6 PASS
2. JoinIR/VM Bridge improvements
- Simplified join_ir_vm_bridge.rs dispatch logic
- Enhanced json.rs serialization
- PHI core boxes cleanup (local_scope_inspector, loop_exit_liveness, loop_var_classifier)
3. Stage-1 CLI enhancements
- Extended args.rs, groups.rs, mod.rs for new options
- Improved stage1_bridge module (args, env, mod)
- Updated stage1_cli.hako
4. MIR builder cleanup
- Simplified if_form.rs control flow
- Removed dead code from loop_builder.rs
- Enhanced phi_merge.rs
5. Runner module updates
- json_v0_bridge/lowering.rs improvements
- dispatch.rs, selfhost.rs, modes/vm.rs cleanup
6. Documentation updates
- CURRENT_TASK.md, AGENTS.md
- Various docs/ updates
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-11-26 10:17:37 +09:00 |
|
|
|
0455307418
|
refactor(phase-a): remove Cranelift/JIT backend legacy code (~373 lines)
Phase A cleanup - Safe deletions with zero risk:
## Deleted Files (6 files, 373 lines total)
1. Cranelift/JIT Backend (321 lines):
- src/runner/modes/cranelift.rs (45 lines)
- src/runner/modes/aot.rs (55 lines)
- src/runner/jit_direct.rs (152 lines)
- src/tests/core13_smoke_jit.rs (42 lines)
- src/tests/core13_smoke_jit_map.rs (27 lines)
2. Legacy MIR Builder (52 lines):
- src/mir/builder/exprs_legacy.rs
- Functionality inlined into exprs.rs (control flow constructs)
## Module Reference Cleanup
- src/backend/mod.rs: Removed cranelift feature gate exports
- src/runner/mod.rs: Removed jit_direct module reference
- src/runner/modes/mod.rs: Removed aot module reference
- src/mir/builder.rs: Removed exprs_legacy module
## Impact Analysis
- Build: Success (cargo build --release)
- Tests: All passing
- Risk Level: None (feature already archived, code unused)
- Related: Phase 15 JIT archival (archive/jit-cranelift/)
## BID Copilot Status
- Already removed in previous cleanup
- Not part of this commit
Total Reduction: 373 lines (~0.4% of codebase)
Next: Phase B - Dead code investigation
Related: #phase-21.0-cleanup
Part of: Legacy Code Cleanup Initiative
|
2025-11-06 22:34:18 +09:00 |
|
|
|
77d4fd72b3
|
phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
|
2025-11-06 15:41:52 +09:00 |
|
|
|
6ce06501e1
|
json-native: enable float roundtrip in parser (NUMBER => float by '.'/exp); expand roundtrip smoke with more numeric cases
|
2025-09-26 00:32:20 +09:00 |
|
|
|
c8063c9e41
|
pyvm: split op handlers into ops_core/ops_box/ops_ctrl; add ops_flow + intrinsic; delegate vm.py without behavior change
net-plugin: modularize constants (consts.rs) and sockets (sockets.rs); remove legacy commented socket code; fix unused imports
mir: move instruction unit tests to tests/mir_instruction_unit.rs (file lean-up); no semantic changes
runner/pyvm: ensure using pre-strip; misc docs updates
Build: cargo build ok; legacy cfg warnings remain as before
|
2025-09-21 08:53:00 +09:00 |
|
|
|
d99b941218
|
docs: add MIR13 mode doc and set PHI-off as default; bridge lowering split (if/loop/try); llvmlite resolver stabilization; curated runner default PHI-off; refresh CURRENT_TASK.md
|
2025-09-17 10:58:12 +09:00 |
|