Moe Charm (CI)
4f2bcb7d32
Refactor: Phase 2 Box化 - SuperSlab Lookup Box with multiple contract levels
Purpose: Formalize SuperSlab lookup responsibilities with clear safety guarantees
Evolution:
- Phase 12: UNSAFE mask+dereference (5-10 cycles) → 12% crash rate
- Phase 1b: SAFE registry lookup (50-100 cycles) → 0% crash rate
- Phase 2: Box化 - multiple contracts (UNSAFE/SAFE/GUARDED)
Box Pattern Benefits:
1. Clear Contracts: Each API documents preconditions and guarantees
2. Multiple Levels: Choose speed vs safety based on context
3. Future-Proof: Enables optimizations without breaking existing code
API Design:
- ss_lookup_unsafe(): 5-10 cycles, requires validated pointer (internal use only)
- ss_lookup_safe(): 50-100 cycles, works with arbitrary pointers (recommended)
- ss_lookup_guarded(): 100-200 cycles, adds integrity checks (debug only)
- ss_fast_lookup(): Backward compatible (→ ss_lookup_safe)
Implementation:
- Created core/box/superslab_lookup_box.h with full contract documentation
- Integrated into core/superslab/superslab_inline.h
- ss_lookup_safe() implemented as macro to avoid circular dependency
- ss_lookup_guarded() only available in debug builds
- Removed conflicting extern declarations from 3 locations
Testing:
- Build: Success (all warnings resolved)
- Crash rate: 0% (50/50 iterations passed)
- Backward compatibility: Maintained via ss_fast_lookup() macro
Future Optimization Opportunities (documented in Box):
- Phase 2.1: Hybrid lookup (try UNSAFE first, fallback to SAFE)
- Phase 2.2: Per-thread cache (1-2 cycles hit rate)
- Phase 2.3: Hardware-assisted validation (PAC/CPUID)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 08:44:29 +09:00
..
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-07 01:27:04 +09:00
2025-11-20 07:32:30 +09:00
2025-11-16 06:36:02 +09:00
2025-11-20 07:32:30 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 01:45:30 +09:00
2025-11-29 07:57:49 +09:00
2025-11-29 06:57:03 +09:00
2025-11-13 01:45:30 +09:00
2025-11-29 08:44:29 +09:00
2025-11-28 01:10:26 +09:00
2025-11-29 06:47:13 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-26 12:33:49 +09:00
2025-11-07 01:27:04 +09:00
2025-11-21 23:00:24 +09:00
2025-11-26 12:33:49 +09:00
2025-11-07 01:27:04 +09:00
2025-11-20 07:32:30 +09:00
2025-11-29 06:57:03 +09:00
2025-11-07 01:27:04 +09:00
2025-11-17 02:47:58 +09:00
2025-11-29 06:47:13 +09:00
2025-11-17 02:47:58 +09:00
2025-11-15 22:08:51 +09:00
2025-11-27 03:41:07 +09:00
2025-11-16 07:51:37 +09:00
2025-11-26 17:12:41 +09:00
2025-11-28 18:04:32 +09:00
2025-11-17 02:47:58 +09:00
2025-11-07 01:27:04 +09:00
2025-11-15 23:00:21 +09:00
2025-11-07 01:27:04 +09:00
2025-11-27 03:18:33 +09:00
2025-11-20 07:32:30 +09:00
2025-11-12 02:45:00 +09:00
2025-11-12 02:45:00 +09:00
2025-11-28 16:08:44 +09:00
2025-11-28 17:10:32 +09:00
2025-11-07 01:27:04 +09:00
2025-11-17 02:47:58 +09:00
2025-11-17 02:47:58 +09:00
2025-11-17 02:47:58 +09:00
2025-11-28 17:10:32 +09:00
2025-11-11 01:47:06 +09:00
2025-11-06 21:54:12 +09:00
2025-11-06 21:54:12 +09:00
2025-11-06 21:54:12 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-06 21:54:12 +09:00
2025-11-20 07:32:30 +09:00
2025-11-26 12:33:49 +09:00
2025-11-13 01:45:30 +09:00
2025-11-13 06:50:20 +09:00
2025-11-28 13:42:39 +09:00
2025-11-22 03:30:47 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 14:11:37 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 14:11:37 +09:00
2025-11-17 05:29:08 +09:00
2025-11-16 07:51:37 +09:00
2025-11-16 05:48:59 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-22 02:46:57 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 13:42:39 +09:00
2025-11-26 12:33:49 +09:00
2025-11-12 02:45:00 +09:00
2025-11-29 08:44:29 +09:00
2025-11-29 07:57:49 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 13:42:39 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-20 07:32:30 +09:00
2025-11-28 13:42:39 +09:00
2025-11-29 07:57:49 +09:00
2025-11-29 08:44:29 +09:00
2025-11-22 06:50:38 +09:00
2025-11-17 02:47:58 +09:00
2025-11-29 06:57:03 +09:00
2025-11-17 02:47:58 +09:00