Commit Graph

8 Commits

Author SHA1 Message Date
79674c9390 Phase v10: Remove legacy v3/v4/v5 implementations
Removal strategy: Deprecate routes by disabling ENV-based routing
- v3/v4/v5 enum types kept for binary compatibility
- small_heap_v3/v4/v5_enabled() always return 0
- small_heap_v3/v4/v5_class_enabled() always return 0
- Any v3/v4/v5 ENVs are silently ignored, routes to LEGACY

Changes:
- core/box/smallobject_hotbox_v3_env_box.h: stub functions
- core/box/smallobject_hotbox_v4_env_box.h: stub functions
- core/box/smallobject_v5_env_box.h: stub functions
- core/front/malloc_tiny_fast.h: remove alloc/free cases (20+ lines)

Benefits:
- Cleaner routing logic (v6/v7 only for SmallObject)
- 20+ lines deleted from hot path validation
- No behavioral change (routes were rarely used)

Performance: No regression expected (v3/v4/v5 already disabled by default)

Next: Set Learner v7 default ON, production testing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 06:09:12 +09:00
ed7e1285eb Phase v7-6: Mixed A/B + Learner design (workload-dependent routes)
Mixed 16-1024B A/B results:
- v7 OFF: 41.3M ops/s (baseline)
- v7 C6-only: 41.5M ops/s (+0.5%)
- v7 C5+C6: 38.0M ops/s (-8.0%) ← C5 hurts in Mixed!

Key finding: C5 route is workload-dependent
- C5+C6 heavy (257-768B): C5+C6 v7 is +4.3% faster
- Mixed 16-1024B: C5+C6 v7 is -8.0% slower

Learner design:
- SmallLearnerStatsV7 aggregate structure
- small_policy_v7_update_from_learner() API
- L3 updates snapshot, L1/L0 reads only

C4 v7 and Intrusive LIFO marked as on-hold.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 05:18:44 +09:00
d5aa3110c6 Phase v7-5b: C5+C6 multi-class expansion (+4.3% improvement)
- Add C5 (256B blocks) support alongside C6 (512B blocks)
- Same segment shared between C5/C6 (page_meta.class_idx distinguishes)
- SMALL_V7_CLASS_SUPPORTED() macro for class validation
- Extend small_v7_block_size() for C5 (switch statement)

A/B Result: C6-only v7 avg 7.64M ops/s → C5+C6 v7 avg 7.97M ops/s (+4.3%)
Criteria: C6 protected , C5 net positive , TLS bloat none 

ENV: HAKMEM_SMALL_HEAP_V7_CLASSES=0x60 (bit5+bit6)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 05:11:02 +09:00
17ceed619c Phase v7-5a: Hot path stats removal (C6 v7 極限最適化)
- Remove per-page stats from hot path (alloc_count, free_count, live_current)
- Add ENV-gated global atomic stats (HAKMEM_V7_HOT_STATS)
- Stats now collected only at retire time (cold path)
- Header write kept at alloc time (freelist overlaps block[0])

A/B Result: -4.3% overhead → ±0% (target: legacy ±2%)
v7 OFF avg: 9.26M ops/s, v7 ON avg: 9.27M ops/s (+0.15%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 04:51:17 +09:00
ea905b2ccb docs: HAKMEM v2 generation summary and Phase v7-4 completion
- Add HAKMEM_V2_GENERATION_SUMMARY.md: comprehensive overview of v2 generation
- Update CURRENT_TASK.md: 'v2 generation complete' section
- Update SMALLOBJECT_V7_DESIGN.md: Phase v7-4 completion notes + v7-5 candidates

v2 generation freeze: ULTRA (FROZEN) / MID_v3 (stable) / v7 (research, code freeze)
Next: HakORune / JoinIR priority, HAKMEM resumes at v7-5 (multi-class expansion)

Layer structure (L0-L3) established, Box Theory implementation patterns confirmed.
Design documents serve as maps for future v7 second chapter.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-12 04:00:55 +09:00
8143e8b797 Phase v7-4: Policy Box 導入 (L3 層の明確化とフロント芯の作り直し)
- SmallPolicyV7 Box: L3 Policy layer に配置、route 決定を一元化
- Route kind enum: SMALL_ROUTE_ULTRA / V7 / MID_V3 / LEGACY
- ENV priority (fixed): ULTRA > v7 > MID_v3 > LEGACY
- Frontend integration: v7 routing を Policy Box 経由に変更 (段階移行)
- Legacy compatibility: 既存の tiny_route_env_box.h は併用維持

Box Theory layer structure:
- L0: ULTRA (C4-C7, FROZEN)
- L1: SmallObject v7 (research box)
- L1': MID_v3 / LEGACY (fallback)
- L2: Segment / RegionId
- L3: Policy / Stats / Learner ← Policy Box added here

Frontend now follows clean "size→class→route_kind→switch" pattern.
ENV variables read once at Policy init, not scattered across frontend.

Future: ULTRA/MID_v3/LEGACY consolidation, Learner integration, flexible priority.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 03:50:58 +09:00
0af409260d docs: Phase v7-2 results + Phase v7-3 design (TLS fast path + page_meta cache) 2025-12-12 03:13:13 +09:00
39a3c53dbc Phase v7-2: SmallObject v7 C6-only implementation with RegionIdBox integration
- SmallSegment_v7: 2MiB segment with TLS slot and free page stack
- ColdIface_v7: Page refill/retire between HotBox and SegmentBox
- HotBox_v7: Full C6-only alloc/free with header writing (HEADER_MAGIC|class_idx)
- Free path early-exit: Check v7 route BEFORE ss_fast_lookup (separate mmap segment)
- RegionIdBox: Register v7 segment for ptr->region lookup
- Benchmark: v7 ON ~54.5M ops/s (-7% overhead vs 58.6M legacy baseline)

v7 correctly balances alloc/free counts and page lifecycle.
RegionIdBox overhead identified as primary cost driver.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-12 03:12:28 +09:00