Phase 75-2: C5-only Inline Slots (P2) - GO (+1.10%)

Extends Phase 75-1 pattern to C5 class (28.5% of C4-C7 ops):
- Created 4 new boxes: env_box, tls_box, fast_path_api, TLS variable
- Integration: 2 minimal boundary points (alloc/free for C5)
- Test strategy: C5-only isolation (baseline C5=OFF+C6=ON, treatment C5=ON+C6=ON)
- Default OFF: zero overhead when disabled

Results (10-run Mixed SSOT, WS=400, C6 already enabled):
- Baseline (C5=OFF, C6=ON): 44.26 M ops/s (σ=0.37)
- Treatment (C5=ON, C6=ON): 44.74 M ops/s (σ=0.54)
- Delta: +0.49 M ops/s (+1.10%)

Status:  GO - C5 individual contribution confirmed
Cumulative since Phase 75-0: +2.87% (C6) + 1.10% (C5) = potential +3.97% combined
Next: Phase 75-3 (test C5+C6 interaction + non-additivity + promote to preset default)

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

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Moe Charm (CI)
2025-12-18 08:39:48 +09:00
parent 0009ce13b3
commit 043d34ad5a
12 changed files with 1076 additions and 13 deletions

View File

@ -14,6 +14,8 @@
#include "tiny_unified_cache_fastapi_env_box.h" // Phase 74-3: FASTAPI ENV gate
#include "tiny_c6_inline_slots_env_box.h" // Phase 75-1: C6 inline slots ENV gate
#include "../front/tiny_c6_inline_slots.h" // Phase 75-1: C6 inline slots API
#include "tiny_c5_inline_slots_env_box.h" // Phase 75-2: C5 inline slots ENV gate
#include "../front/tiny_c5_inline_slots.h" // Phase 75-2: C5 inline slots API
// Purpose: Encapsulate legacy free logic (shared by multiple paths)
// Called by: malloc_tiny_fast.h (free path) + tiny_c6_ultra_free_box.c (C6 fallback)
@ -25,8 +27,22 @@
//
__attribute__((always_inline))
static inline void tiny_legacy_fallback_free_base_with_env(void* base, uint32_t class_idx, const HakmemEnvSnapshot* env) {
// Phase 75-2: C5 Inline Slots early-exit (ENV gated)
// Try C5 inline slots FIRST (before C6 and unified cache) for class 5
if (class_idx == 5 && tiny_c5_inline_slots_enabled()) {
if (c5_inline_push(c5_inline_tls(), base)) {
// Success: pushed to C5 inline slots
FREE_PATH_STAT_INC(legacy_fallback);
if (__builtin_expect(free_path_stats_enabled(), 0)) {
g_free_path_stats.legacy_by_class[class_idx]++;
}
return;
}
// FULL → fall through to C6/unified cache
}
// Phase 75-1: C6 Inline Slots early-exit (ENV gated)
// Try C6 inline slots FIRST (before unified cache) for class 6
// Try C6 inline slots SECOND (before unified cache) for class 6
if (class_idx == 6 && tiny_c6_inline_slots_enabled()) {
if (c6_inline_push(c6_inline_tls(), base)) {
// Success: pushed to C6 inline slots