Files
hakmem/docs/analysis/PHASE78_1_INLINE_SLOTS_FIXED_MODE_RESULTS.md

62 lines
1.8 KiB
Markdown
Raw Normal View History

# Phase 78-1: Inline Slots Fixed Mode (C3/C4/C5/C6) — Results
## Goal
Remove per-operation ENV gate overhead for C3/C4/C5/C6 inline slots by caching the enable decisions at a single boundary (`bench_profile` refresh), while keeping Box Theory properties:
- Single boundary
- Reversible via ENV
- Fail-fast (no mid-run toggling assumptions)
- Minimal observability (perf + throughput)
## Change Summary
- New box: `core/box/tiny_inline_slots_fixed_mode_box.{h,c}`
- ENV: `HAKMEM_TINY_INLINE_SLOTS_FIXED=0/1` (default `0`)
- When enabled, caches:
- `HAKMEM_TINY_C3_INLINE_SLOTS`
- `HAKMEM_TINY_C4_INLINE_SLOTS`
- `HAKMEM_TINY_C5_INLINE_SLOTS`
- `HAKMEM_TINY_C6_INLINE_SLOTS`
- Hot path uses `tiny_c{3,4,5,6}_inline_slots_enabled_fast()`.
- Integration boundary:
- `core/bench_profile.h`: calls `tiny_inline_slots_fixed_mode_refresh_from_env()` after preset `putenv` defaults.
- Hot path call sites migrated:
- `core/box/tiny_front_hot_box.h`
- `core/box/tiny_legacy_fallback_box.h`
- `core/front/tiny_c{3,4,5,6}_inline_slots.h`
## A/B Method
- Same binary A/B (layout-safe): `scripts/run_mixed_10_cleanenv.sh`
- Workload: Mixed SSOT, `ITERS=20000000`, `WS=400`, `RUNS=10`
- Toggle:
- Baseline: `HAKMEM_TINY_INLINE_SLOTS_FIXED=0`
- Treatment: `HAKMEM_TINY_INLINE_SLOTS_FIXED=1`
## Results (10-run)
Computed via AWK summary:
- Baseline (FIXED=0): mean `54.54M ops/s`, CV `0.51%`
- Treatment (FIXED=1): mean `55.80M ops/s`, CV `0.57%`
- Delta: `+2.31%`
Decision: **GO** (exceeds +1.0% threshold).
## Promotion
For Mixed preset/cleanenv SSOT alignment:
- `core/bench_profile.h`: `HAKMEM_TINY_INLINE_SLOTS_FIXED=1` default
- `scripts/run_mixed_10_cleanenv.sh`: `HAKMEM_TINY_INLINE_SLOTS_FIXED=1` default
Rollback:
```sh
export HAKMEM_TINY_INLINE_SLOTS_FIXED=0
```