Phase 13 v1 + E5-2 retest: Both NEUTRAL, freeze as research boxes
Phase 13 v1: Header Write Elimination (C7 preserve header)
- Verdict: NEUTRAL (+0.78%)
- Implementation: HAKMEM_TINY_C7_PRESERVE_HEADER ENV gate (default OFF)
- Makes C7 nextptr offset conditional (0→1 when enabled)
- 4-point matrix A/B test results:
* Case A (baseline): 51.49M ops/s
* Case B (WRITE_ONCE=1): 52.07M ops/s (+1.13%)
* Case C (C7_PRESERVE=1): 51.36M ops/s (-0.26%)
* Case D (both): 51.89M ops/s (+0.78% NEUTRAL)
- Action: Freeze as research box (default OFF, manual opt-in)
Phase 5 E5-2: Header Write-Once retest (promotion test)
- Verdict: NEUTRAL (+0.54%)
- Motivation: Phase 13 Case B showed +1.13%, re-tested with dedicated 20-run
- Results (20-run):
* Case A (baseline): 51.10M ops/s
* Case B (WRITE_ONCE=1): 51.37M ops/s (+0.54%)
- Previous test: +0.45% (consistent with NEUTRAL)
- Action: Keep as research box (default OFF, manual opt-in)
Key findings:
- Header write tax optimization shows consistent NEUTRAL results
- Neither Phase 13 v1 nor E5-2 reaches GO threshold (+1.0%)
- Both implemented as reversible ENV gates for future research
Files changed:
- New: core/box/tiny_c7_preserve_header_env_box.{c,h}
- Modified: core/box/tiny_layout_box.h (C7 offset conditional)
- Modified: core/tiny_nextptr.h, core/box/tiny_header_box.h (comments)
- Modified: core/bench_profile.h (refresh sync)
- Modified: Makefile (add new .o files)
- Modified: scripts/run_mixed_10_cleanenv.sh (add C7_PRESERVE ENV)
- Docs: PHASE13_*, PHASE5_E5_2_HEADER_WRITE_ONCE_* (design/results)
Next: Phase 14 (Pointer-chase reduction, tcache-style intrusive LIFO)
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
// tiny_nextptr.h - Authoritative next-pointer offset/load/store for tiny boxes
|
||||
//
|
||||
// Finalized Phase E1-CORRECT spec (物理制約込み):
|
||||
// P0.1 updated: C0 and C7 use offset 0, C1-C6 use offset 1 (header preserved)
|
||||
// P0.1 updated: C0 uses offset 0, C1-C6 use offset 1 (header preserved)
|
||||
// Phase 13 v1: C7 uses offset 0 (default) or 1 (HAKMEM_TINY_C7_PRESERVE_HEADER=1)
|
||||
//
|
||||
// HAKMEM_TINY_HEADER_CLASSIDX != 0 のとき:
|
||||
//
|
||||
@ -18,8 +19,8 @@
|
||||
//
|
||||
// Class 7:
|
||||
// [1B header][payload 2047B]
|
||||
// → headerは上書きし、next は base+0 に格納(最大サイズなので許容)
|
||||
// → next_off = 0
|
||||
// → next_off = 0 (default: headerは上書き)
|
||||
// → next_off = 1 (Phase 13 v1: HAKMEM_TINY_C7_PRESERVE_HEADER=1)
|
||||
//
|
||||
// HAKMEM_TINY_HEADER_CLASSIDX == 0 のとき:
|
||||
//
|
||||
@ -56,7 +57,8 @@ static __thread void* g_tiny_next_ra1 __attribute__((unused)) = NULL;
|
||||
static __thread void* g_tiny_next_ra2 __attribute__((unused)) = NULL;
|
||||
|
||||
// Compute freelist next-pointer offset within a block for the given class.
|
||||
// P0.1 updated: C0 and C7 use offset 0, C1-C6 use offset 1 (header preserved)
|
||||
// P0.1: C0 uses offset 0, C1-C6 use offset 1 (header preserved)
|
||||
// Phase 13 v1: C7 uses offset 0 (default) or 1 (HAKMEM_TINY_C7_PRESERVE_HEADER=1)
|
||||
// Rationale for C0: 8B stride cannot fit [1B header][8B next pointer] without overflow
|
||||
static inline __attribute__((always_inline)) size_t tiny_next_off(int class_idx) {
|
||||
return tiny_nextptr_offset(class_idx);
|
||||
@ -186,7 +188,8 @@ static inline __attribute__((always_inline)) void* tiny_next_load(const void* ba
|
||||
// - When class_map is used for class_idx lookup (default), header restoration is unnecessary
|
||||
// - Alloc path always writes fresh header before returning block to user (HAK_RET_ALLOC)
|
||||
// - ENV: HAKMEM_TINY_RESTORE_HEADER=1 to force header restoration (legacy mode)
|
||||
// P0.1: C7 uses offset 0 (overwrites header), C0-C6 use offset 1 (header preserved)
|
||||
// P0.1: C0 uses offset 0 (overwrites header), C1-C6 use offset 1 (header preserved)
|
||||
// Phase 13 v1: C7 uses offset 0 (default) or 1 (HAKMEM_TINY_C7_PRESERVE_HEADER=1)
|
||||
static inline __attribute__((always_inline)) void tiny_next_store(void* base, int class_idx, void* next) {
|
||||
size_t off = tiny_next_off(class_idx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user