From 19056282b605fa202ca992298344307aea004fef Mon Sep 17 00:00:00 2001 From: "Moe Charm (CI)" Date: Sat, 13 Dec 2025 22:03:27 +0900 Subject: [PATCH] Phase 3 D2: Wrapper Env Cache - [DECISION: NO-GO] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Target: Reduce wrapper_env_cfg() overhead in malloc/free hot path - Strategy: Cache wrapper env configuration pointer in TLS - Approach: Fast pointer cache (TLS caches const wrapper_env_cfg_t*) Implementation: - core/box/wrapper_env_cache_env_box.h: ENV gate (HAKMEM_WRAP_ENV_CACHE) - core/box/wrapper_env_cache_box.h: TLS cache layer (wrapper_env_cfg_fast) - core/box/hak_wrappers.inc.h: Integration into malloc/free hot paths - ENV gate: HAKMEM_WRAP_ENV_CACHE=0/1 (default OFF) A/B Test Results (Mixed, 10-run, 20M iters): - Baseline (D2=0): 46.52M ops/s (avg), 46.47M ops/s (median) - Optimized (D2=1): 45.85M ops/s (avg), 45.98M ops/s (median) - Improvement: avg -1.44%, median -1.05% (DECISION: NO-GO) Analysis: - Regression cause: TLS cache adds overhead (branch + TLS access) - wrapper_env_cfg() is already minimal (pointer return after simple check) - Adding TLS caching layer makes it worse, not better - Branch prediction penalty outweighs any potential savings Cumulative Phase 2-3: - B3: +2.89%, B4: +1.47%, C3: +2.20% - D1: +1.06% (opt-in), D2: -1.44% (NO-GO) - Total: ~7.2% (excluding D2) Decision: FREEZE as research box (default OFF, regression confirmed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 --- core/box/carve_push_box.d | 8 + core/box/free_publish_box.d | 10 +- core/box/front_gate_box.d | 33 +- core/box/front_gate_classifier.d | 6 + core/box/hak_wrappers.inc.h | 7 +- core/box/mailbox_box.d | 10 +- core/box/prewarm_box.d | 8 + core/box/superslab_expansion_box.d | 12 +- core/box/wrapper_env_cache_box.h | 25 + core/box/wrapper_env_cache_env_box.h | 25 + core/tiny_alloc_fast_push.d | 6 + core/tiny_failfast.d | 10 +- docs/analysis/ENV_PROFILE_PRESETS.md | 6 +- .../PHASE3_BASELINE_AND_CANDIDATES.md | 444 ++++++++++++++++++ .../PHASE3_C1_TLS_PREFETCH_1_DESIGN.md | 13 + .../PHASE3_C2_METADATA_CACHE_1_DESIGN.md | 286 +++++++++++ ...PHASE3_CACHE_LOCALITY_NEXT_INSTRUCTIONS.md | 137 +++--- .../PHASE3_D2_WRAPPER_ENV_CACHE_1_DESIGN.md | 87 ++++ ...3_D3_ALLOC_GATE_SPECIALIZATION_1_DESIGN.md | 87 ++++ hakmem.d | 43 +- hakmem_learner.d | 10 +- hakmem_pool.d | 32 +- hakmem_shared_pool.d | 16 +- hakmem_super_registry.d | 10 +- hakmem_tiny_bg_spill.d | 8 +- hakmem_tiny_magazine.d | 14 +- hakmem_tiny_query.d | 10 +- hakmem_tiny_sfc.d | 34 +- hakmem_tiny_stats.d | 10 +- tiny_adaptive_sizing.d | 12 +- tiny_fastcache.d | 8 +- tiny_publish.d | 10 +- tiny_remote.d | 10 +- tiny_sticky.d | 10 +- 34 files changed, 1317 insertions(+), 140 deletions(-) create mode 100644 core/box/wrapper_env_cache_box.h create mode 100644 core/box/wrapper_env_cache_env_box.h create mode 100644 docs/analysis/PHASE3_BASELINE_AND_CANDIDATES.md create mode 100644 docs/analysis/PHASE3_C2_METADATA_CACHE_1_DESIGN.md create mode 100644 docs/analysis/PHASE3_D2_WRAPPER_ENV_CACHE_1_DESIGN.md create mode 100644 docs/analysis/PHASE3_D3_ALLOC_GATE_SPECIALIZATION_1_DESIGN.md diff --git a/core/box/carve_push_box.d b/core/box/carve_push_box.d index 3eff0adb..ed6bd540 100644 --- a/core/box/carve_push_box.d +++ b/core/box/carve_push_box.d @@ -15,6 +15,10 @@ core/box/carve_push_box.o: core/box/carve_push_box.c \ core/box/../superslab/../box/ss_addr_map_box.h \ core/box/../superslab/../box/../hakmem_build_flags.h \ core/box/../superslab/../box/super_reg_box.h \ + core/box/../superslab/../box/ss_pt_lookup_box.h \ + core/box/../superslab/../box/ss_pt_types_box.h \ + core/box/../superslab/../box/ss_pt_env_box.h \ + core/box/../superslab/../box/ss_pt_env_box.h \ core/box/../tiny_debug_ring.h core/box/../tiny_remote.h \ core/box/../hakmem_tiny_superslab_constants.h \ core/box/../hakmem_tiny_config.h core/box/../hakmem_tiny_superslab.h \ @@ -66,6 +70,10 @@ core/box/../superslab/../hakmem_tiny_superslab.h: core/box/../superslab/../box/ss_addr_map_box.h: core/box/../superslab/../box/../hakmem_build_flags.h: core/box/../superslab/../box/super_reg_box.h: +core/box/../superslab/../box/ss_pt_lookup_box.h: +core/box/../superslab/../box/ss_pt_types_box.h: +core/box/../superslab/../box/ss_pt_env_box.h: +core/box/../superslab/../box/ss_pt_env_box.h: core/box/../tiny_debug_ring.h: core/box/../tiny_remote.h: core/box/../hakmem_tiny_superslab_constants.h: diff --git a/core/box/free_publish_box.d b/core/box/free_publish_box.d index aff407d9..bc8e3cab 100644 --- a/core/box/free_publish_box.d +++ b/core/box/free_publish_box.d @@ -9,7 +9,11 @@ core/box/free_publish_box.o: core/box/free_publish_box.c \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/hakmem_build_flags.h core/tiny_remote.h \ core/hakmem_tiny_superslab_constants.h core/hakmem_tiny.h \ core/hakmem_trace.h core/hakmem_tiny_mini_mag.h \ @@ -30,6 +34,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/hakmem_build_flags.h: core/tiny_remote.h: diff --git a/core/box/front_gate_box.d b/core/box/front_gate_box.d index a5c1bfd3..90250e23 100644 --- a/core/box/front_gate_box.d +++ b/core/box/front_gate_box.d @@ -12,20 +12,21 @@ core/box/front_gate_box.o: core/box/front_gate_box.c \ core/superslab/superslab_types.h core/superslab/../tiny_box_geometry.h \ core/tiny_debug_ring.h core/tiny_remote.h core/box/ss_addr_map_box.h \ core/box/../hakmem_build_flags.h core/box/super_reg_box.h \ - core/tiny_debug_api.h core/box/tiny_layout_box.h \ - core/box/../hakmem_tiny_config.h core/box/tiny_header_box.h \ - core/box/tiny_layout_box.h core/box/../tiny_region_id.h \ - core/box/tls_sll_box.h core/box/../hakmem_internal.h \ - core/box/../hakmem.h core/box/../hakmem_build_flags.h \ - core/box/../hakmem_config.h core/box/../hakmem_features.h \ - core/box/../hakmem_sys.h core/box/../hakmem_whale.h \ - core/box/../box/ptr_type_box.h core/box/../hakmem_debug_master.h \ - core/box/../tiny_remote.h core/box/../hakmem_tiny_integrity.h \ - core/box/../hakmem_tiny.h core/box/../ptr_track.h \ - core/box/../ptr_trace.h core/box/../hakmem_trace_master.h \ - core/box/../hakmem_stats_master.h core/box/../tiny_debug_ring.h \ - core/box/ss_addr_map_box.h core/box/../superslab/superslab_inline.h \ - core/box/tiny_ptr_bridge_box.h \ + core/box/ss_pt_lookup_box.h core/box/ss_pt_types_box.h \ + core/box/ss_pt_env_box.h core/box/ss_pt_env_box.h core/tiny_debug_api.h \ + core/box/tiny_layout_box.h core/box/../hakmem_tiny_config.h \ + core/box/tiny_header_box.h core/box/tiny_layout_box.h \ + core/box/../tiny_region_id.h core/box/tls_sll_box.h \ + core/box/../hakmem_internal.h core/box/../hakmem.h \ + core/box/../hakmem_build_flags.h core/box/../hakmem_config.h \ + core/box/../hakmem_features.h core/box/../hakmem_sys.h \ + core/box/../hakmem_whale.h core/box/../box/ptr_type_box.h \ + core/box/../hakmem_debug_master.h core/box/../tiny_remote.h \ + core/box/../hakmem_tiny_integrity.h core/box/../hakmem_tiny.h \ + core/box/../ptr_track.h core/box/../ptr_trace.h \ + core/box/../hakmem_trace_master.h core/box/../hakmem_stats_master.h \ + core/box/../tiny_debug_ring.h core/box/ss_addr_map_box.h \ + core/box/../superslab/superslab_inline.h core/box/tiny_ptr_bridge_box.h \ core/box/../hakmem_tiny_superslab_internal.h \ core/box/../hakmem_tiny_superslab.h core/box/../box/ss_hot_cold_box.h \ core/box/../box/../superslab/superslab_types.h \ @@ -66,6 +67,10 @@ core/tiny_remote.h: core/box/ss_addr_map_box.h: core/box/../hakmem_build_flags.h: core/box/super_reg_box.h: +core/box/ss_pt_lookup_box.h: +core/box/ss_pt_types_box.h: +core/box/ss_pt_env_box.h: +core/box/ss_pt_env_box.h: core/tiny_debug_api.h: core/box/tiny_layout_box.h: core/box/../hakmem_tiny_config.h: diff --git a/core/box/front_gate_classifier.d b/core/box/front_gate_classifier.d index 7f68f8e2..95d434b8 100644 --- a/core/box/front_gate_classifier.d +++ b/core/box/front_gate_classifier.d @@ -12,6 +12,8 @@ core/box/front_gate_classifier.o: core/box/front_gate_classifier.c \ core/box/../tiny_debug_ring.h core/box/../tiny_remote.h \ core/box/../box/ss_addr_map_box.h \ core/box/../box/../hakmem_build_flags.h core/box/../box/super_reg_box.h \ + core/box/../box/ss_pt_lookup_box.h core/box/../box/ss_pt_types_box.h \ + core/box/../box/ss_pt_env_box.h core/box/../box/ss_pt_env_box.h \ core/box/../hakmem_tiny.h core/box/../hakmem_trace.h \ core/box/../hakmem_tiny_mini_mag.h \ core/box/../box/hak_lane_classify.inc.h core/box/../box/ptr_type_box.h \ @@ -40,6 +42,10 @@ core/box/../tiny_remote.h: core/box/../box/ss_addr_map_box.h: core/box/../box/../hakmem_build_flags.h: core/box/../box/super_reg_box.h: +core/box/../box/ss_pt_lookup_box.h: +core/box/../box/ss_pt_types_box.h: +core/box/../box/ss_pt_env_box.h: +core/box/../box/ss_pt_env_box.h: core/box/../hakmem_tiny.h: core/box/../hakmem_trace.h: core/box/../hakmem_tiny_mini_mag.h: diff --git a/core/box/hak_wrappers.inc.h b/core/box/hak_wrappers.inc.h index ae137b83..15a3d992 100644 --- a/core/box/hak_wrappers.inc.h +++ b/core/box/hak_wrappers.inc.h @@ -35,6 +35,7 @@ void* realloc(void* ptr, size_t size) { #include "tiny_alloc_gate_box.h" // Tiny Alloc Gatekeeper Box (BASE/USER+Bridge 入口) #include "tiny_front_config_box.h" // Phase 4-Step3: Compile-time config for dead code elimination #include "wrapper_env_box.h" // Wrapper env cache (step trace / LD safe / free trace) +#include "wrapper_env_cache_box.h" // Phase 3 D2: TLS cache for wrapper_env_cfg pointer #include "../hakmem_internal.h" // AllocHeader helpers for diagnostics #include "../hakmem_super_registry.h" // Superslab lookup for diagnostics #include "../superslab/superslab_inline.h" // slab_index_for, capacity @@ -169,7 +170,8 @@ void* malloc(size_t size) { } // Phase 2 B4: Hot/Cold dispatch (HAKMEM_WRAP_SHAPE) - const wrapper_env_cfg_t* wcfg = wrapper_env_cfg(); + // Phase 3 D2: Use wrapper_env_cfg_fast() to reduce hot path overhead + const wrapper_env_cfg_t* wcfg = wrapper_env_cfg_fast(); if (__builtin_expect(wcfg->wrap_shape, 0)) { // B4 Optimized: Hot/Cold split // CRITICAL FIX (BUG #7): Increment lock depth FIRST, before ANY libc calls @@ -547,7 +549,8 @@ void free(void* ptr) { // Fallback to normal path for non-Tiny or no-header mode } - const wrapper_env_cfg_t* wcfg = wrapper_env_cfg(); + // Phase 3 D2: Use wrapper_env_cfg_fast() to reduce hot path overhead + const wrapper_env_cfg_t* wcfg = wrapper_env_cfg_fast(); // Phase 2 B4: HAKMEM_WRAP_SHAPE dispatch (hot/cold split for free) if (__builtin_expect(wcfg->wrap_shape, 0)) { diff --git a/core/box/mailbox_box.d b/core/box/mailbox_box.d index a2add4fd..e92d797e 100644 --- a/core/box/mailbox_box.d +++ b/core/box/mailbox_box.d @@ -8,7 +8,11 @@ core/box/mailbox_box.o: core/box/mailbox_box.c core/box/mailbox_box.h \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/hakmem_build_flags.h core/tiny_remote.h \ core/hakmem_tiny_superslab_constants.h core/hakmem_tiny.h \ core/hakmem_trace.h core/hakmem_tiny_mini_mag.h \ @@ -28,6 +32,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/hakmem_build_flags.h: core/tiny_remote.h: diff --git a/core/box/prewarm_box.d b/core/box/prewarm_box.d index d85f171c..01cfc16e 100644 --- a/core/box/prewarm_box.d +++ b/core/box/prewarm_box.d @@ -15,6 +15,10 @@ core/box/prewarm_box.o: core/box/prewarm_box.c core/box/../hakmem_tiny.h \ core/box/../superslab/../box/ss_addr_map_box.h \ core/box/../superslab/../box/../hakmem_build_flags.h \ core/box/../superslab/../box/super_reg_box.h \ + core/box/../superslab/../box/ss_pt_lookup_box.h \ + core/box/../superslab/../box/ss_pt_types_box.h \ + core/box/../superslab/../box/ss_pt_env_box.h \ + core/box/../superslab/../box/ss_pt_env_box.h \ core/box/../tiny_debug_ring.h core/box/../tiny_remote.h \ core/box/../hakmem_tiny_superslab_constants.h \ core/box/../hakmem_tiny_config.h core/box/../hakmem_tiny_superslab.h \ @@ -40,6 +44,10 @@ core/box/../superslab/../hakmem_tiny_superslab.h: core/box/../superslab/../box/ss_addr_map_box.h: core/box/../superslab/../box/../hakmem_build_flags.h: core/box/../superslab/../box/super_reg_box.h: +core/box/../superslab/../box/ss_pt_lookup_box.h: +core/box/../superslab/../box/ss_pt_types_box.h: +core/box/../superslab/../box/ss_pt_env_box.h: +core/box/../superslab/../box/ss_pt_env_box.h: core/box/../tiny_debug_ring.h: core/box/../tiny_remote.h: core/box/../hakmem_tiny_superslab_constants.h: diff --git a/core/box/superslab_expansion_box.d b/core/box/superslab_expansion_box.d index fb3c94a2..3d7243b3 100644 --- a/core/box/superslab_expansion_box.d +++ b/core/box/superslab_expansion_box.d @@ -14,6 +14,10 @@ core/box/superslab_expansion_box.o: core/box/superslab_expansion_box.c \ core/box/../superslab/../box/ss_addr_map_box.h \ core/box/../superslab/../box/../hakmem_build_flags.h \ core/box/../superslab/../box/super_reg_box.h \ + core/box/../superslab/../box/ss_pt_lookup_box.h \ + core/box/../superslab/../box/ss_pt_types_box.h \ + core/box/../superslab/../box/ss_pt_env_box.h \ + core/box/../superslab/../box/ss_pt_env_box.h \ core/box/../tiny_debug_ring.h core/box/../hakmem_build_flags.h \ core/box/../tiny_remote.h core/box/../hakmem_tiny_superslab_constants.h \ core/box/../hakmem_tiny_superslab.h \ @@ -34,7 +38,7 @@ core/box/superslab_expansion_box.o: core/box/superslab_expansion_box.c \ core/hakmem_tiny_config.h core/tiny_nextptr.h core/hakmem_build_flags.h \ core/tiny_region_id.h core/superslab/superslab_inline.h \ core/box/tiny_layout_box.h core/box/../hakmem_tiny_config.h \ - core/box/tiny_header_box.h core/box/../hakmem_build_flags.h \ + core/box/../hakmem_build_flags.h core/box/tiny_header_box.h \ core/box/tiny_layout_box.h core/box/../tiny_region_id.h \ core/box/../box/slab_freelist_atomic.h \ core/box/../hakmem_tiny_superslab_constants.h @@ -54,6 +58,10 @@ core/box/../superslab/../hakmem_tiny_superslab.h: core/box/../superslab/../box/ss_addr_map_box.h: core/box/../superslab/../box/../hakmem_build_flags.h: core/box/../superslab/../box/super_reg_box.h: +core/box/../superslab/../box/ss_pt_lookup_box.h: +core/box/../superslab/../box/ss_pt_types_box.h: +core/box/../superslab/../box/ss_pt_env_box.h: +core/box/../superslab/../box/ss_pt_env_box.h: core/box/../tiny_debug_ring.h: core/box/../hakmem_build_flags.h: core/box/../tiny_remote.h: @@ -91,8 +99,8 @@ core/tiny_region_id.h: core/superslab/superslab_inline.h: core/box/tiny_layout_box.h: core/box/../hakmem_tiny_config.h: -core/box/tiny_header_box.h: core/box/../hakmem_build_flags.h: +core/box/tiny_header_box.h: core/box/tiny_layout_box.h: core/box/../tiny_region_id.h: core/box/../box/slab_freelist_atomic.h: diff --git a/core/box/wrapper_env_cache_box.h b/core/box/wrapper_env_cache_box.h new file mode 100644 index 00000000..cfd76ac3 --- /dev/null +++ b/core/box/wrapper_env_cache_box.h @@ -0,0 +1,25 @@ +// wrapper_env_cache_box.h - TLS cache layer for wrapper env config (Phase 3 D2) +// Purpose: Eliminate repeated wrapper_env_cfg() calls in malloc/free hot path +// Strategy: Cache the const pointer in TLS (safe, no refresh sync needed) +#pragma once + +#include "wrapper_env_box.h" // wrapper_env_cfg() +#include "wrapper_env_cache_env_box.h" // wrap_env_cache_enabled() + +// Fast pointer cache: TLS caches the pointer to g_wrapper_env +// Safety: wrapper_env_refresh_from_env() doesn't change the pointer address, +// only the content of g_wrapper_env, so TLS cache remains valid. +static inline const wrapper_env_cfg_t* wrapper_env_cfg_fast(void) { + if (__builtin_expect(!wrap_env_cache_enabled(), 1)) { + // Cache disabled (default): use baseline wrapper_env_cfg() + return wrapper_env_cfg(); + } + + // Cache enabled: TLS fast pointer + static __thread const wrapper_env_cfg_t* cached_ptr = NULL; + if (__builtin_expect(cached_ptr == NULL, 0)) { + // First access: initialize TLS cache with pointer to g_wrapper_env + cached_ptr = wrapper_env_cfg(); + } + return cached_ptr; +} diff --git a/core/box/wrapper_env_cache_env_box.h b/core/box/wrapper_env_cache_env_box.h new file mode 100644 index 00000000..e2056493 --- /dev/null +++ b/core/box/wrapper_env_cache_env_box.h @@ -0,0 +1,25 @@ +// wrapper_env_cache_env_box.h - ENV gate for wrapper env cache optimization (Phase 3 D2) +// Purpose: Control TLS caching of wrapper_env_cfg pointer to reduce hot path overhead +#pragma once + +#include // getenv + +// ENV gate: HAKMEM_WRAP_ENV_CACHE (default: 0) +// 0 = OFF (use wrapper_env_cfg() directly, baseline) +// 1 = ON (cache wrapper_env_cfg pointer in TLS, optimized) +static inline int wrap_env_cache_enabled(void) { + static int cached = -1; // -1: uninitialized, 0: OFF, 1: ON + if (__builtin_expect(cached == -1, 0)) { + const char* env = getenv("HAKMEM_WRAP_ENV_CACHE"); + cached = (env && *env && *env != '0') ? 1 : 0; +#if !HAKMEM_BUILD_RELEASE + // One-shot log in debug builds + static int logged = 0; + if (!logged) { + fprintf(stderr, "[WRAP_ENV_CACHE] %s (default: OFF)\n", cached ? "ON" : "OFF"); + logged = 1; + } +#endif + } + return cached; +} diff --git a/core/tiny_alloc_fast_push.d b/core/tiny_alloc_fast_push.d index da0a17e2..0e017e06 100644 --- a/core/tiny_alloc_fast_push.d +++ b/core/tiny_alloc_fast_push.d @@ -18,6 +18,8 @@ core/tiny_alloc_fast_push.o: core/tiny_alloc_fast_push.c \ core/box/../tiny_debug_ring.h core/box/../tiny_remote.h \ core/box/../box/ss_addr_map_box.h \ core/box/../box/../hakmem_build_flags.h core/box/../box/super_reg_box.h \ + core/box/../box/ss_pt_lookup_box.h core/box/../box/ss_pt_types_box.h \ + core/box/../box/ss_pt_env_box.h core/box/../box/ss_pt_env_box.h \ core/box/../hakmem_tiny.h core/box/../hakmem_trace.h \ core/box/../hakmem_tiny_mini_mag.h \ core/box/../box/hak_lane_classify.inc.h core/box/../tiny_debug_api.h \ @@ -71,6 +73,10 @@ core/box/../tiny_remote.h: core/box/../box/ss_addr_map_box.h: core/box/../box/../hakmem_build_flags.h: core/box/../box/super_reg_box.h: +core/box/../box/ss_pt_lookup_box.h: +core/box/../box/ss_pt_types_box.h: +core/box/../box/ss_pt_env_box.h: +core/box/../box/ss_pt_env_box.h: core/box/../hakmem_tiny.h: core/box/../hakmem_trace.h: core/box/../hakmem_tiny_mini_mag.h: diff --git a/core/tiny_failfast.d b/core/tiny_failfast.d index e4098d0c..61f555bc 100644 --- a/core/tiny_failfast.d +++ b/core/tiny_failfast.d @@ -8,7 +8,11 @@ core/tiny_failfast.o: core/tiny_failfast.c core/hakmem_tiny_superslab.h \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/hakmem_build_flags.h core/tiny_remote.h \ core/hakmem_tiny_superslab_constants.h core/hakmem_debug_master.h core/hakmem_tiny_superslab.h: @@ -24,6 +28,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/hakmem_build_flags.h: core/tiny_remote.h: diff --git a/docs/analysis/ENV_PROFILE_PRESETS.md b/docs/analysis/ENV_PROFILE_PRESETS.md index bb6e4934..b5fe641d 100644 --- a/docs/analysis/ENV_PROFILE_PRESETS.md +++ b/docs/analysis/ENV_PROFILE_PRESETS.md @@ -13,7 +13,7 @@ - v4 系(C6/C7 v4、fast classify v4、small segment v4)はすべて OFF。 - Tiny/Pool v2 もすべて OFF。 - **v7 (C5/C6) は OFF** (Phase v10: Mixed 本線では v7 無効化、C5/C6 専用プリセット参照) -- C6 は凍結中(Tiny/SmallObject の特別扱いなし)。mid/pool の通常経路に任せる。 +- Mixed 本線では **MID v3 (C6)** をデフォルト OFF に固定し、C6 も Tiny LEGACY(unified cache)で処理する(Mixed で MID v3 が大きく遅くなるため)。 ### ENV 最小セット(Release) ```sh @@ -41,8 +41,8 @@ HAKMEM_BENCH_MAX_SIZE=1024 - `HAKMEM_WRAP_SHAPE=1`(Phase 2 B4: wrapper hot/cold split を default ON) - `HAKMEM_TINY_ALLOC_ROUTE_SHAPE=1`(Phase 2 B3: alloc の route dispatch 形を最適化) - `HAKMEM_TINY_STATIC_ROUTE=1`(Phase 3 C3: policy_snapshot bypass を default ON) -- `HAKMEM_MID_V3_ENABLED=1`(Phase MID-V3: 257-768B, C6 only) -- `HAKMEM_MID_V3_CLASSES=0x40`(C6 only, C7 は ULTRA に任せる) +- `HAKMEM_MID_V3_ENABLED=0`(Mixed 本線では OFF。C6-heavy のみ推奨ON) +- `HAKMEM_MID_V3_CLASSES=0x0`(Mixed 本線では未使用) - `HAKMEM_MID_V35_ENABLED=0`(Phase v11a-5: Mixed では MID v3.5 OFF が最速) ### 任意オプション diff --git a/docs/analysis/PHASE3_BASELINE_AND_CANDIDATES.md b/docs/analysis/PHASE3_BASELINE_AND_CANDIDATES.md new file mode 100644 index 00000000..ac86f4b1 --- /dev/null +++ b/docs/analysis/PHASE3_BASELINE_AND_CANDIDATES.md @@ -0,0 +1,444 @@ +# Phase 3: Baseline Establishment & Next Optimization Candidates + +**Date**: 2025-12-13 +**Status**: BASELINE ESTABLISHED +**Goal**: Identify next micro-optimization targets with +1-5% potential each + +--- + +## Executive Summary + +**Baseline Performance (MID_V3=0, MIXED workload)**: +- Mean: 45.78M ops/s +- Median: 46.79M ops/s +- Range: 42.36M - 47.12M ops/s +- StdDev: ~1.75M ops/s (3.8% variance) + +**Top Optimization Candidates**: +1. **free() wrapper** (28.95% self%) - HIGH PRIORITY +2. **tiny_alloc_gate_fast()** (12.75% self%) - HIGH PRIORITY +3. **main() benchmark overhead** (12.53% self%) - IGNORE (benchmark artifact) + +**Expected Next Gains**: +3-8% cumulative from free path optimizations + +--- + +## Step 0: Baseline Establishment + +### Configuration Verification + +**Profile**: `HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE` + +**Key Settings** (verified in `/mnt/workdisk/public_share/hakmem/core/bench_profile.h:74`): +```c +bench_setenv_default("HAKMEM_MID_V3_ENABLED", "0"); // CRITICAL: MID_V3 disabled for Mixed +bench_setenv_default("HAKMEM_MID_V3_CLASSES", "0x0"); +``` + +**Optimization Flags Enabled**: +- `HAKMEM_FREE_TINY_FAST_HOTCOLD=1` (Phase FREE-TINY-FAST-DUALHOT-1) +- `HAKMEM_WRAP_SHAPE=1` (Phase 2 B4: Hot/Cold wrapper split) +- `HAKMEM_TINY_ALLOC_ROUTE_SHAPE=1` (Phase 2 B3: Route branch optimization) +- `HAKMEM_TINY_STATIC_ROUTE=1` (Phase 3 C3: Static routing, +2.2%) + +### Baseline Measurements (5 runs) + +| Run | Throughput (M ops/s) | Time (ms) | +|-----|---------------------|-----------| +| 1 | 46.84 | 21 | +| 2 | 46.79 | 21 | +| 3 | 45.77 | 22 | +| 4 | 47.12 | 21 | +| 5 | 42.36 | 24 | + +**Statistics**: +- **Mean**: 45.78M ops/s +- **Median**: 46.79M ops/s +- **Min**: 42.36M ops/s +- **Max**: 47.12M ops/s +- **Range**: 4.76M ops/s (11.2%) +- **StdDev**: ~1.75M ops/s (3.8% variance) + +**Assessment**: Baseline is stable with ~3.8% variance. Run 5 (42.36M) is an outlier, likely due to system noise. Median (46.79M) is a reliable baseline reference. + +**Comparison to Previous**: +- Previous C3 baseline: ~39.8M ops/s (with default settings) +- **Current baseline: 46.79M ops/s** +- **Improvement: +17.5%** (confirms MID_V3=0 + cumulative optimizations working) + +--- + +## Step 1: Perf Profiling Results + +### Profiling Setup + +**Command**: +```bash +HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE perf record -F 99 -g ./bench_random_mixed_hakmem 10000000 400 1 +``` + +**Results**: +- Samples: 30 (cycles:P event) +- Event count: 921,849,973 cycles +- Throughput: 47.37M ops/s (consistent with baseline) + +### Top Functions by Self% + +| Rank | Symbol | Self% | Samples | Children% | Category | +|------|-------------------------------------|--------|---------|-----------|-----------------| +| 1 | `free` | 28.95% | 3 | 45.20% | **HOT WRAPPER** | +| 2 | `tiny_alloc_gate_fast.lto_priv.0` | 12.75% | 3 | 29.11% | **HOT ALLOC** | +| 3 | `main` | 12.53% | 3 | 21.00% | Benchmark | +| 4 | `malloc` | 12.43% | 3 | 16.71% | Wrapper | +| 5 | `tiny_front_v3_enabled.lto_priv.0` | 7.75% | 2 | 7.85% | Tiny front | +| 6 | `tiny_route_for_class.lto_priv.0` | 4.39% | 2 | 24.78% | Route lookup | +| 7 | `free.cold` | 4.15% | 1 | 4.15% | Cold path | +| 8 | `hak_pool_free` | 4.02% | 1 | 4.02% | Pool free | + +### Call Graph Analysis + +**free() hot path** (28.95% self, 45.20% children): +``` +free (28.95% self) +├── tiny_route_for_class.lto_priv.0 (20.38%) ← MAJOR BOTTLENECK +├── free (recursive, 16.24%) +├── tiny_region_id_write_header.lto_priv.0 (4.29%) +└── malloc (4.28%) +``` + +**tiny_alloc_gate_fast** (12.75% self, 29.11% children): +``` +tiny_alloc_gate_fast (12.75% self) +├── tiny_alloc_gate_fast (recursive inlining, 20.64%) +├── main (4.27%) +└── free (4.20%) +``` + +**Key Insight**: `tiny_route_for_class()` is called from `free()` and consuming 20.38% of total time. This is the **#1 optimization target**. + +--- + +## Step 2: Candidate Prioritization + +### HIGH PRIORITY (Expected +3-5% each) + +#### 1. **free() wrapper path** (28.95% self%) +**Location**: `/mnt/workdisk/public_share/hakmem/core/box/hak_wrappers.inc.h:524` + +**Current Implementation**: +```c +void free(void* ptr) { + if (!ptr) return; + + // BenchFast bypass (unlikely, 0) + if (__builtin_expect(bench_fast_enabled(), 0)) { ... } + + const wrapper_env_cfg_t* wcfg = wrapper_env_cfg(); // ← Memory load + + if (__builtin_expect(wcfg->wrap_shape, 0)) { // ← Branch + if (__builtin_expect(TINY_FRONT_UNIFIED_GATE_ENABLED, 1)) { + int freed; + if (__builtin_expect(hak_free_tiny_fast_hotcold_enabled(), 0)) { + freed = free_tiny_fast_hot(ptr); + } else { + freed = free_tiny_fast(ptr); + } + if (__builtin_expect(freed, 1)) { + return; // SUCCESS + } + } + return free_cold(ptr, wcfg); + } + // Legacy path... +} +``` + +**Optimization Opportunities**: + +**A. Cache `wrapper_env_cfg()` result** (Expected: +1-2%) +- Currently calls `wrapper_env_cfg()` on every free +- Could cache in TLS or register during init +- Risk: LOW (read-only after init) + +**B. Inline `free_tiny_fast_hot()` decision** (Expected: +1-2%) +- Branch `hak_free_tiny_fast_hotcold_enabled()` is runtime env check +- Could be compile-time or init-time cached +- Risk: LOW (already gated by HAKMEM_FREE_TINY_FAST_HOTCOLD) + +**C. Reduce branch mispredictions** (Expected: +0.5-1%) +- Reorder branches to put likely path first +- Current: `bench_fast_enabled()` checked first (unlikely=0) +- Optimization: Move Tiny fast path check earlier +- Risk: LOW + +**Total Expected Gain: +2.5-5%** + +#### 2. **tiny_route_for_class()** (4.39% self%, 24.78% children) +**Location**: `/mnt/workdisk/public_share/hakmem/core/box/tiny_route_env_box.h:147` + +**Current Implementation**: +```c +static inline tiny_route_kind_t tiny_route_for_class(uint8_t ci) { + FREE_DISPATCH_STAT_INC(route_for_class_calls); // Debug stat (RELEASE: noop) + if (__builtin_expect(!g_tiny_route_snapshot_done, 0)) { + tiny_route_snapshot_init(); + } + if (__builtin_expect(ci >= TINY_NUM_CLASSES, 0)) { + return TINY_ROUTE_LEGACY; + } + return g_tiny_route_class[ci]; +} +``` + +**Optimization Opportunities**: + +**A. Eliminate `g_tiny_route_snapshot_done` check** (Expected: +1-2%) +- Check happens on EVERY call from free path +- Phase 3 C3 already implemented static routing for alloc path +- **Proposal**: Apply same static route cache to free path +- Implementation: Add `tiny_static_route_for_free(ci)` that bypasses snapshot check +- Risk: MEDIUM (need to ensure init ordering) + +**B. Remove bounds check `ci >= TINY_NUM_CLASSES`** (Expected: +0.5-1%) +- In free path, `ci` is derived from header (already validated) +- Could add `tiny_route_for_class_unchecked(ci)` variant +- Risk: MEDIUM (need careful caller audit) + +**Total Expected Gain: +1.5-3%** + +#### 3. **tiny_alloc_gate_fast()** (12.75% self%) +**Location**: `/mnt/workdisk/public_share/hakmem/core/box/tiny_alloc_gate_box.h:139` + +**Current Implementation**: +```c +static inline void* tiny_alloc_gate_fast(size_t size) +{ + int class_idx = hak_tiny_size_to_class(size); + if (__builtin_expect(class_idx < 0 || class_idx >= TINY_NUM_CLASSES, 0)) { + return NULL; + } + + TinyRoutePolicy route = tiny_route_get(class_idx); // ← Already optimized (Phase 3 C3) + + if (__builtin_expect(route == ROUTE_POOL_ONLY, 0)) { + return NULL; + } + + void* user_ptr = malloc_tiny_fast_for_class(size, class_idx); + + if (__builtin_expect(route == ROUTE_TINY_ONLY, 1)) { + return user_ptr; + } + + // ROUTE_TINY_FIRST fallback... +} +``` + +**Optimization Opportunities**: + +**A. Specialize for common routes** (Expected: +1-2%) +- MIXED workload: C0-C7 are all ROUTE_TINY_ONLY (LEGACY) +- Could create `tiny_alloc_gate_fast_legacy_only()` variant +- Eliminates ROUTE_POOL_ONLY and ROUTE_TINY_FIRST checks +- Risk: LOW (already profiled via HAKMEM_TINY_STATIC_ROUTE) + +**B. Inline `malloc_tiny_fast_for_class()`** (Expected: +0.5-1%) +- Might not be fully inlined by LTO +- Add `__attribute__((always_inline))` hint +- Risk: LOW + +**Total Expected Gain: +1.5-3%** + +--- + +### MEDIUM PRIORITY (Expected +0.5-1% each) + +#### 4. **tiny_front_v3_enabled()** (7.75% self%) +- Appears in free path via `free_tiny_fast_hot()` +- Likely a runtime env check that could be cached +- Risk: LOW +- Expected Gain: +0.5-1% + +#### 5. **free.cold** (4.15% self%) +- Cold path for free wrapper +- Handles classification and fallback +- Not a hot optimization target (already in slow path) +- Expected Gain: <+0.5% + +--- + +### LOW PRIORITY / IGNORE + +#### 6. **main()** (12.53% self%) +- Benchmark overhead (not part of allocator) +- IGNORE + +#### 7. **malloc()** (12.43% self%) +- Already optimized in previous phases +- Appears lower than free in profile +- Defer to next round + +--- + +## Step 3: Recommended Next Steps + +### Phase 3 D1: Free Path Route Cache (HIGH PRIORITY) +**Target**: `tiny_route_for_class()` eliminating snapshot check in free path +**Expected Gain**: +1-2% +**Risk**: MEDIUM +**Effort**: 2-3 hours + +**Implementation**: +1. Add `tiny_static_route_for_free(ci)` function (mirror of alloc path optimization) +2. Cache route decisions at init time in `g_tiny_static_route_free[8]` +3. Update `free_tiny_fast_hot()` to use cached route +4. A/B test: BASELINE vs D1 + +**ENV Gate**: `HAKMEM_FREE_STATIC_ROUTE=1` (default: 0) + +--- + +### Phase 3 D2: Wrapper Env Cache (HIGH PRIORITY) +**Target**: `wrapper_env_cfg()` caching in free path +**Expected Gain**: +1-2% +**Risk**: LOW +**Effort**: 1-2 hours + +**Implementation**: +1. Cache `wrapper_env_cfg()` result in TLS or init-time global +2. Avoid repeated memory load on every free() call +3. Update free wrapper to use cached pointer +4. A/B test: BASELINE vs D2 + +**ENV Gate**: `HAKMEM_WRAP_ENV_CACHE=1` (default: 0) + +--- + +### Phase 3 D3: Alloc Gate Specialization (MEDIUM PRIORITY) +**Target**: `tiny_alloc_gate_fast()` for LEGACY-only route +**Expected Gain**: +1-2% +**Risk**: LOW +**Effort**: 2-3 hours + +**Implementation**: +1. Create `tiny_alloc_gate_fast_legacy()` specialized variant +2. Eliminate ROUTE_POOL_ONLY and ROUTE_TINY_FIRST branches +3. Use in MIXED profile where all classes are LEGACY +4. A/B test: BASELINE vs D3 + +**ENV Gate**: `HAKMEM_ALLOC_GATE_LEGACY_ONLY=1` (default: 0) + +--- + +## Expected Cumulative Results + +| Phase | Optimization | Expected Gain | Cumulative | +|------------|----------------------------------|---------------|-------------| +| Baseline | MID_V3=0 + B3+B4+C3 | - | 46.79M ops/s| +| **Phase 3 D1** | Free route cache | +1-2% | 47.3-47.7M | +| **Phase 3 D2** | Wrapper env cache | +1-2% | 47.8-48.7M | +| **Phase 3 D3** | Alloc gate specialization | +1-2% | 48.3-49.7M | +| **Total Expected** | - | **+3-6%** | **48-50M ops/s** | + +**With MID_V3 fix for Mixed**: +13% additional (expected ~56M ops/s total) + +--- + +## Risk Assessment + +| Optimization | Risk Level | Mitigation | +|---------------------|------------|-------------------------------------------------| +| Free route cache | MEDIUM | Ensure init ordering, ENV gate for rollback | +| Wrapper env cache | LOW | Read-only after init, simple TLS cache | +| Alloc specialization| LOW | Profile-specific, existing static route pattern | + +**All optimizations**: Follow ENV gate + A/B test + decision pattern (research box) + +--- + +## Next Actions + +1. **Immediate**: Implement Phase 3 D1 (Free route cache) + - Expected: +1-2% gain + - Risk: MEDIUM (requires careful init ordering) + - Timeline: 2-3 hours + +2. **Follow-up**: Implement Phase 3 D2 (Wrapper env cache) + - Expected: +1-2% gain + - Risk: LOW + - Timeline: 1-2 hours + +3. **Optional**: Implement Phase 3 D3 (Alloc gate specialization) + - Expected: +1-2% gain + - Risk: LOW + - Timeline: 2-3 hours + +**Total Timeline**: 5-8 hours for +3-6% cumulative improvement + +--- + +## Appendix: Raw Perf Data + +### Full Perf Report (Top 20) + +``` +# Samples: 30 of event 'cycles:P' +# Event count (approx.): 921849973 + + 46.11% 0.00% 0 [.] 0000000000000000 + 45.20% 28.95% 3 [.] free + 29.11% 12.75% 3 [.] tiny_alloc_gate_fast.lto_priv.0 + 24.78% 4.39% 2 [.] tiny_route_for_class.lto_priv.0 + 21.00% 12.53% 3 [.] main + 16.71% 12.43% 3 [.] malloc + 12.95% 4.27% 1 [.] tiny_region_id_write_header.lto_priv.0 + 8.66% 4.39% 1 [.] tiny_c7_ultra_free + 8.56% 4.28% 1 [.] free_tiny_fast_cold.lto_priv.0 + 7.85% 7.75% 2 [.] tiny_front_v3_enabled.lto_priv.0 + 4.27% 0.00% 0 [.] 0x00007ad3a9c2d001 + 4.23% 0.00% 0 [.] tiny_c7_ultra_enabled_env.lto_priv.0 + 4.21% 0.00% 0 [.] 0x00007ad3ab960c81 + 4.20% 0.00% 0 [.] 0x00007ad3ab939401 + 4.15% 4.15% 1 [.] free.cold + 4.15% 0.00% 0 [.] unified_cache_push.lto_priv.0 + 4.02% 4.02% 1 [.] hak_pool_free +``` + +### Baseline Run Details + +**Run 1**: 46.84M ops/s +``` +Throughput = 46841499 ops/s [iter=1000000 ws=400] time=0.021s +[RSS] max_kb=30208 +``` + +**Run 2**: 46.79M ops/s +``` +Throughput = 46793317 ops/s [iter=1000000 ws=400] time=0.021s +[RSS] max_kb=30080 +``` + +**Run 3**: 45.77M ops/s +``` +Throughput = 45772756 ops/s [iter=1000000 ws=400] time=0.022s +[RSS] max_kb=34176 +``` + +**Run 4**: 47.12M ops/s +``` +Throughput = 47117176 ops/s [iter=1000000 ws=400] time=0.021s +[RSS] max_kb=30080 +``` + +**Run 5**: 42.36M ops/s (outlier) +``` +Throughput = 42359615 ops/s [iter=1000000 ws=400] time=0.024s +[RSS] max_kb=30080 +``` + +--- + +## Document History + +- **2025-12-13**: Initial baseline establishment and candidate analysis +- **Next**: Phase 3 D1 implementation (Free route cache) diff --git a/docs/analysis/PHASE3_C1_TLS_PREFETCH_1_DESIGN.md b/docs/analysis/PHASE3_C1_TLS_PREFETCH_1_DESIGN.md index 3282e1c3..d14b1992 100644 --- a/docs/analysis/PHASE3_C1_TLS_PREFETCH_1_DESIGN.md +++ b/docs/analysis/PHASE3_C1_TLS_PREFETCH_1_DESIGN.md @@ -67,3 +67,16 @@ prefetch は “刺さるときだけ刺さる”。 勝ち筋は「route 形の整理(B3/B4/C3)で instruction が減った結果、メモリ待ちが相対的に目立つ」状態になっていること。 もし勝てないなら、次は C2(metadata locality)へ進む。 +--- + +## 結果(A/B) + +**判定**: 🔬 NEUTRAL(研究箱維持、default OFF) + +- Mixed 10-run: + - `HAKMEM_TINY_PREFETCH=0`: avg **39.34M** + - `HAKMEM_TINY_PREFETCH=1`: avg **39.20M**(avg **-0.34%** / median **+1.28%**) + +**補足**: +- 既存実装は “LEGACY 分岐の直前” に prefetch を入れており lead time が短い。 +- 再挑戦するなら、prefetch 位置を **より早い入口**(`malloc_tiny_fast_for_class()` 冒頭など)に動かして A/B を取り直す。 diff --git a/docs/analysis/PHASE3_C2_METADATA_CACHE_1_DESIGN.md b/docs/analysis/PHASE3_C2_METADATA_CACHE_1_DESIGN.md new file mode 100644 index 00000000..c52b2363 --- /dev/null +++ b/docs/analysis/PHASE3_C2_METADATA_CACHE_1_DESIGN.md @@ -0,0 +1,286 @@ +# Phase 3 C2: Slab Metadata Cache Optimization 設計メモ + +## 目的 + +Free path が全体の **29-31%** を占める中、metadata access(policy snapshot, slab descriptor)の cache locality を改善。 + +**期待**: **+5-10%** 改善 + +--- + +## 結果(A/B) + +**判定**: 🔬 NEUTRAL(研究箱維持、default OFF) + +- Mixed 10-run: + - Baseline(`HAKMEM_TINY_METADATA_CACHE=0`): avg **40.43M** / median **40.72M** + - Optimized(`HAKMEM_TINY_METADATA_CACHE=1`): avg **40.25M** / median **40.29M** + - Delta: avg **-0.45%** / median **-1.06%** + +**理由(要約)**: +- policy hot cache: learner interlock の probe コストが gain を相殺 +- first page cache: “lookup が支配的” な状況ではなかった(free 側は既に軽い) +- bounds check: 既にコンパイラ最適化が効いていた + +--- + +## 観察と根拠 + +### 現状のメモリアクセスパターン(Free path) + +``` +free(ptr) + → tiny_free_fast() + ① TLS g_unified_cache[class] 取得 [L1 miss 確率: ~5%] + ② policy_snapshot() / static_route [L1 miss 確率: ~2%] + ③ slab descriptor lookup(superslab, segment) [L1 miss 確率: ~8%] + ④ slots[] array write [L1 miss 確率: ~10%] +``` + +**ボトルネック**: ③ slab descriptor lookup +- Tiny クラス(C0-C3): `tiny_legacy_fallback_free_base()` +- それ以上: `small_heap_free()` → policy → route → handler + +### 改善対象 + +1. **Policy struct**: 現在は global + TLS キャッシュ + - 理想: Hot member(route_kind[8], learner_v7_enabled)だけを TLS に複製 + +2. **Slab descriptor**: `SmallSegment` or `SmallPageMeta` lookup + - 現在: 64-byte alignment の metadata struct (複数 cache line) + - 改善案: First page descriptor を inline TLS context に(C0-C7 の "second tier" キャッシュ) + +3. **Unified cache slot[]**: 既に TLS だが、array bounds check のため head/tail 更新が頻繁 + - 改善案: `capacity` をマクロ定数化して bounds check を compile-out + +--- + +## Box Theory(実装計画) + +### L0: Env(戻せる) + +``` +HAKMEM_TINY_METADATA_CACHE=0/1 # default: 0(OFF) +``` + +- 目的: metadata hot 配置の on/off(回帰時に即戻せる) + +### L1: MetadataCacheBox(境界: 2 箇所) + +#### 1.1 Policy Hot Cache + +**責務**: Free path での policy_snapshot() をスキップ + +```c +// tiny_env_box.h に追加 +typedef struct { + uint8_t route_kind[8]; // C0-C7 route (copied from policy, not learner-synced) + uint8_t learner_v7_enabled; // Boolean: is learner v7 active? +} TinyPolicyHot; // 9 bytes packed, fits in 16-byte slot + +extern __thread TinyPolicyHot g_policy_hot; +``` + +**初期化**: +- malloc/free entry で `tiny_policy_hot_refresh()`(policy_snapshot() の代わり) +- learner_v7 enabled 時は disable(learner は動的に route_kind を更新) + +#### 1.2 Slab First Page Inline + +**責務**: Slab descriptor lookup の "first hit" 率向上 + +```c +// tiny_front_hot_box.h に追加(TLS context) +typedef struct { + // Tiny LEGACY cache + void* first_page_base; // Current page pointer (avoid superslab lookup) + uint16_t first_page_free_count; // Free slots in current page +} TinyFirstPageCache; + +extern __thread TinyFirstPageCache g_first_page_cache[8]; // Per-class +``` + +**ライフサイクル**: +- Refill 時: first_page_cache[class] = new page +- Retire 時: first_page_cache[class] = NULL(次の refill で update) + +### L2: Integration Points(2 箇所) + +#### 2.1 Free path(目標) + +```c +// tiny_legacy_fallback_box.h +inline void tiny_legacy_fallback_free_base(...) { + if (tiny_metadata_cache_enabled()) { + // Fast: Check cached first page + if (ptr >= g_first_page_cache[class].base && + ptr < g_first_page_cache[class].base + PAGE_SIZE) { + // Hit: update counter, push to unified cache + ... + return; + } + } + // Slow: standard superslab lookup + ... +} +``` + +#### 2.2 Policy hot cache refresh + +```c +// malloc/free wrapper +if (__builtin_expect(small_policy_v7_version_changed(), 0)) { + if (tiny_metadata_cache_enabled()) { + tiny_policy_hot_refresh(); // Sync route_kind[8] from policy + } +} +``` + +--- + +## 実装指示(段階的パッチ) + +### Patch 1: Policy Hot Cache(小) + +**ファイル**: +- `core/box/tiny_metadata_cache_env_box.h` (新規) + - ENV gate + - `TinyPolicyHot` struct + +- `core/box/tiny_metadata_cache_hot_box.h` (新規) + - API: `tiny_policy_hot_refresh()` + - TLS: `extern __thread TinyPolicyHot g_policy_hot;` + +- `core/box/tiny_metadata_cache_hot_box.c` (新規) + - Implementation + +**条件**: +- `tiny_metadata_cache_enabled() && route_kind != learner_active` +- `__builtin_expect(tiny_metadata_cache_enabled(), 0)` (rare, ON時のみ) + +**測定対象**: A/B test で +1-3% を期待 + +### Patch 2: First Page Inline Cache(中) + +**ファイル**: +- `core/front/tiny_first_page_cache.h` (新規) + - `TinyFirstPageCache` struct + - `tiny_first_page_cache_hit()` inline check + - `tiny_first_page_cache_update()` on refill + +- `core/front/tiny_legacy_fallback_box.h` (変更) + - free path で first_page_cache check 追加 + +**条件**: +- LEGACY route のみ(MID/ULTRA は不要) +- Refill 時に自動 update + +**測定対象**: Patch 1 + 2 で +3-7% を期待 + +### Patch 3: Bounds Check Compile-out(小最適化) + +**ファイル**: +- `core/front/tiny_unified_cache.h` (変更) + - capacity をマクロ定数化(Hot_2048 strategy の hardcode) + +**条件**: +- compile-time 定数ならば `& (2048-1)` は一度だけ計算 + +**測定対象**: Patch 1+2+3 で +4-9% を期待 + +--- + +## A/B(GO/NO-GO) + +### Test Plan + +**プロファイル**: `HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE` + +**ベースライン**: Patch 0(現在: +2.20% from C3) +``` +HAKMEM_TINY_METADATA_CACHE=0 (default OFF) +``` + +**最適化版**: Patch 1+2 (必須) + Patch 3 (optional) +``` +HAKMEM_TINY_METADATA_CACHE=1 (metadata cache ON) +``` + +**条件**: +- Mixed (10-run) で測定 +- Learner disabled(learner ON 時は policy_hot disable) + +**決定基準**: +- **GO**: +1.0% 以上 +- **NEUTRAL**: ±1.0% → 研究箱維持(Patch 1+2 を default OFF のまま) +- **NO-GO**: -1.0% 以下 → FREEZE(ENV gate で disable) + +--- + +## リスク評価 + +### 安全性チェック + +| リスク | 対策 | +|--------|------| +| Policy hot cache が stale | learner disabled で OFF、bench putenv sync あり | +| First page cache invalid | Refill/retire で explicit invalidate | +| Bounds check miss | Macro hardcode で compile-out(型安全) | +| Lock depth | Free path なので不要 | + +### Rollback + +- `HAKMEM_TINY_METADATA_CACHE=0` で即座に disable +- ENV gate のみ(コード削除不要) + +--- + +## 期待値の根拠 + +**なぜ +5-10% か?** + +1. Policy hot cache: policy_snapshot() bypass → -2 memory ops + - 期待: +1-2% + +2. First page inline: superslab lookup bypass → -1-2 memory ops + - 期待: +2-4% + +3. Bounds check compile-out: modulo 演算の削減 + - 期待: +0.5-1% + +**合計**: +3.5-7% (保守的に見積もると +3-5%) + +--- + +## 実装スケジュール(推定) + +1. **Patch 1 実装** (15-20分) + - Box ファイル作成 + - Cache refresh ロジック + - ENV gate + +2. **Patch 2 実装** (20-30分) + - First page inline cache + - Free path 統合 + +3. **Build & Test** (10分) + - Compile 確認 + - Sanity benchmark + +4. **A/B Test** (15-20分) + - 10-run Mixed + - 統計分析 + +5. **Commit & Summary** (5分) + - GO/NO-GO 判定 + - ドキュメント更新 + +**Total**: 約 65-85 分 + +--- + +## 非目標 + +- ルーティングアルゴリズム変更(metadata cache は "hint" のみ) +- Learner との相互作用修正(disabled 時のみ動作) +- Cold path 最適化(C2 は hot path focused) diff --git a/docs/analysis/PHASE3_CACHE_LOCALITY_NEXT_INSTRUCTIONS.md b/docs/analysis/PHASE3_CACHE_LOCALITY_NEXT_INSTRUCTIONS.md index a8b1343a..33597bcb 100644 --- a/docs/analysis/PHASE3_CACHE_LOCALITY_NEXT_INSTRUCTIONS.md +++ b/docs/analysis/PHASE3_CACHE_LOCALITY_NEXT_INSTRUCTIONS.md @@ -1,103 +1,88 @@ -# Phase 3: Cache Locality 最適化(開始指示) +# Phase 3: Cache Locality(C1/C2/C3 完了後の次指示) -## 目標 +## 現在地(Status) -**現状**: Mixed ~35.2M ops/s (B3+B4 後) -**目標**: 57-68M ops/s (+12-22%) +### C3: Static Routing ✅ ADOPT +- `HAKMEM_TINY_STATIC_ROUTE=1` を `MIXED_TINYV3_C7_SAFE` のデフォルトへ昇格(policy_snapshot bypass) +- 設計メモ: `docs/analysis/PHASE3_C3_STATIC_ROUTING_1_DESIGN.md` -## Phase 3 構成 +### C1: TLS Prefetch 🔬 NEUTRAL / FREEZE +- `HAKMEM_TINY_PREFETCH=1` は Mixed で平均が伸びず(±1%域)→ default OFF 維持 +- 設計メモ: `docs/analysis/PHASE3_C1_TLS_PREFETCH_1_DESIGN.md` -### C3(優先度: 🔴 最高): Static Routing +### C2: Metadata Cache 🔬 NEUTRAL / FREEZE +- `HAKMEM_TINY_METADATA_CACHE=1` は Mixed で平均が伸びず(±1%域)→ default OFF 維持 +- 設計メモ: `docs/analysis/PHASE3_C2_METADATA_CACHE_1_DESIGN.md` -**背景**: -- Mixed の perf top では malloc/policy_snapshot が hot -- 現在: 毎回 malloc 時に policy snapshot + learner evaluation → 大きな overhead -- 案: malloc_tiny_fast() 呼び出し前に "static route" を init 時決定 +### C4: MIXED MID_V3 Routing Fix ✅ ADOPT(大きい勝ち) +- `MIXED_TINYV3_C7_SAFE` のデフォルトを **MID_V3 OFF** に変更(C6 を LEGACY 側へ戻す) +- A/B(Mixed, ws=400, 20M iters, 10-run)で **+13%** を確認 -**設計メモ**: `docs/analysis/PHASE3_C3_STATIC_ROUTING_1_DESIGN.md` +### D1: Free Path Route Cache ✅ GO(ENV opt-in) +- `HAKMEM_FREE_STATIC_ROUTE=1`(default OFF) +- A/B(Mixed, 10-run mean)で **+1.06%**(平均のみ閾値超え。median は負ける場合があるので “候補” 扱い) +- 設計メモ: `docs/analysis/PHASE3_D1_FREE_ROUTE_CACHE_1_DESIGN.md` -**実装ステップ**: +## 次の指示(ガツン) -1. **Profiling(現状把握)** +### Step 0: Baseline 固定(Mixed) + +1. まず “現行デフォルト” で 10-run を取る(比較の基準線) ```bash - HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE ./bench_random_mixed_hakmem 1000000 400 1 - perf record -F 99 --call-graph dwarf -- HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE ./bench_random_mixed_hakmem 1000000 400 1 - perf report --stdio - # → malloc/policy_snapshot/learner がどの程度か確認 + HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE ./bench_random_mixed_hakmem 20000000 400 1 ``` +2. A/B の比較は **同じ iter / ws / threads** を厳守。 -2. **Static Route Detection (init 時)** - - malloc_tiny_fast() が呼ばれる前に route を "決定" - - 対象: C0-C7 の class 別に「LEGACY が dominant か」を判定 - - ENV gate: `HAKMEM_TINY_STATIC_ROUTE=1/0` (default 0) +### Step 1: MID_V3 の扱いを “本線 SSOT” にする -3. **Route Bypass** - ```c - // 現在(毎回評価): - route = g_policy_learner->get_route(class_idx); // 高コスト - - // C3 Static(init 時決定): - if (static_route_enabled()) { - route = g_static_route[class_idx]; // cached, no learner - } else { - route = learner_route(...); // 従来通り - } - ``` +目的: Mixed 本線は **MID_V3 を常時 OFF**、C6-heavy のみ ON を維持する。 -4. **期待**: +5-8% -5. **A/B Test**: Mixed 10-run + C6-heavy 5-run +- `core/bench_profile.h`(プリセット) + - Mixed: `HAKMEM_MID_V3_ENABLED=0`, `HAKMEM_MID_V3_CLASSES=0x0` + - C6-heavy: 既存通り `HAKMEM_MID_V3_ENABLED=1`, `HAKMEM_MID_V3_CLASSES=0x40` +- `docs/analysis/ENV_PROFILE_PRESETS.md`(人間向け SSOT) + - Mixed 本線: MID_V3 OFF を明記 + - C6-heavy: MID_V3 ON 推奨を明記 -### C1(優先度: 🟡 中): TLS Cache Prefetch +GO/NO-GO: +- Mixed (10-run mean): **+1.0% 以上で GO**(既に +13% を観測) +- C6-heavy: 参考(Mixed を最優先) -**狙い**: policy ではなく、実際に alloc が触る **TLS cache**(Unified Cache)をプリフェッチ +### Step 2: 次のボトルネックを “数字で” 決める -**設計メモ**: `docs/analysis/PHASE3_C1_TLS_PREFETCH_1_DESIGN.md` +MID_V3 を切った後に、改めて perf を取り直して “次の芯” を決める。 -**実装**: -```c -// malloc_tiny_fast_for_class() 内で、LEGACY route のときだけ: -__builtin_prefetch(&g_unified_cache[class_idx], 0, 3); +```bash +perf record -F 99 --call-graph dwarf -- \ + HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE ./bench_random_mixed_hakmem 20000000 400 1 +perf report --stdio ``` -**期待**: +2-4% +判定ルール: +- self% が **5% 未満の箱は NO-GO(後回し)** +- 5% 以上の関数/箱だけを次のフェーズ候補にする -### C2(優先度: 🟡 中): Slab Metadata Cache Optimization +### Step 3: Phase 3 D2(Wrapper Env Cache)を実装して A/B -**狙い**: hot metadata(policy, slab descriptor)をより近い場所に配置 +狙い: wrapper 入口の `wrapper_env_cfg()` をさらに軽くして 1–2% 詰める。 -**期待**: +5-10% +- 設計メモ: `docs/analysis/PHASE3_D2_WRAPPER_ENV_CACHE_1_DESIGN.md` +- ENV: `HAKMEM_WRAP_ENV_CACHE=0/1`(default 0) +- A/B: Mixed 10-run(推奨: 20M iters) + - GO: +1.0% 以上 + - NO-GO: -1.0% 以下 + - ±1%: NEUTRAL(研究箱維持) -## 実装フロー +### Step 4: Phase 3 D3(Alloc Gate Specialization)は “perf で 5%超えたら” 着手 -``` -1. C3(Static Routing)実装 & A/B test - ├─ GO: default 化 - └─ NO-GO: freeze - -2. C1(TLS Prefetch)追加実装 - └─ Cumulative test - -3. C2(Metadata Optimization) - └─ Final A/B -``` +狙い: Mixed 本線の固定構成に合わせ、alloc gate の分岐を削って 1–2% 詰める。 -## 安全性確認 +- 設計メモ: `docs/analysis/PHASE3_D3_ALLOC_GATE_SPECIALIZATION_1_DESIGN.md` +- ENV: `HAKMEM_ALLOC_GATE_LEGACY_ONLY=0/1`(default 0) +- 注意: “safe enable 判定” を必ず入れて、ENV 組み合わせで壊れないようにする -- **LD mode**: static route は LD 環境では disable(policy learner は LD で active) -- **Lock depth**: malloc 側なので不要 -- **Rollback**: ENV gate で即時 OFF 可能 +## 次候補(perf で 5% 超なら着手) -## 次のアクション - -**今すぐ**: -1. `perf record -F 99 ./bench_random_mixed_hakmem` を実行して hot spot 特定 -2. policy_snapshot / learner evaluation の overhead 定量化 -3. C3 static route detection の実装開始 - -**以降**: -- A/B テスト(Mixed 10-run)で +5-8% 確認 -- C1/C2 の段階的導入 - ---- - -**背中が見える段階から、さらに奥深く。** +1. `tiny_alloc_gate_fast` / `malloc_tiny_fast_for_class`(alloc 側の形最適化) +2. `free_tiny_fast_*`(free 側第2ホットの追加短絡) +3. wrapper(`malloc`/`free`)の hot 入口の更なる短縮(B4 の次) diff --git a/docs/analysis/PHASE3_D2_WRAPPER_ENV_CACHE_1_DESIGN.md b/docs/analysis/PHASE3_D2_WRAPPER_ENV_CACHE_1_DESIGN.md new file mode 100644 index 00000000..58c280e6 --- /dev/null +++ b/docs/analysis/PHASE3_D2_WRAPPER_ENV_CACHE_1_DESIGN.md @@ -0,0 +1,87 @@ +# Phase 3 D2: Wrapper Env Cache(malloc/free wrapper 入口の負担削減)設計メモ + +## 目的 + +`malloc()` / `free()` の wrapper hot path は B4(hot/cold split)でかなり整形できたが、 +依然として **毎呼び出しで `wrapper_env_cfg()` を通る** 形になっている。 + +この D2 では、wrapper 側の「ENV 設定読み出し」を **さらに軽い形** にして、 +wrapper の入口オーバーヘッドを 1–2% 詰める。 + +## 非目標 + +- ENV の意味や安全フェンス(LD safe / lock depth / init window)を変えない +- wrapper の “cold 側” のロジック再設計はしない +- getenv を hot path に戻さない + +## Box Theory(箱割り) + +### L0: Env(戻せる) + +- ENV gate: `HAKMEM_WRAP_ENV_CACHE=0/1`(default: 0) +- 目的: 回帰したら即 OFF(A/B で戻せる) + +### L1: WrapperEnvCacheBox(境界: wrapper 入口 1箇所) + +責務: wrapper hot path で `wrapper_env_cfg()` の “初期化チェック/分岐” を避け、 +**最短の読み出し形**にする。 + +実装方針(推奨: まずは最小差分) + +1) **Fast pointer**(最小・安全) +- `const wrapper_env_cfg_t*` を TLS に 1 回だけキャッシュし、以降はそれを使う。 +- refresh(`wrapper_env_refresh_from_env()`)が走っても、ポインタは不変なので破綻しない。 + +2) **TLS mirror**(次段、必要なら) +- `wrap_shape` / `ld_safe_mode` 等を TLS にコピー(読み出しを TLS 化)。 +- ただし “refresh 同期” の仕組み(version など)が必要になるので D2 では基本やらない。 + +## 実装指示(小パッチ) + +### Patch D2-1: ENV gate + +- 新規: `core/box/wrapper_env_cache_env_box.h` + - `wrap_env_cache_enabled()`(lazy init, getenv 1回のみ) + - 可能ならワンショットログ(最大 1 回、release では抑制) + +### Patch D2-2: WrapperEnvCacheBox + +- 新規: `core/box/wrapper_env_cache_box.h` + - `wrapper_env_cfg_fast()` を提供 + - `wrap_env_cache_enabled()==0` → `wrapper_env_cfg()` を返す(現状維持) + - `wrap_env_cache_enabled()==1` → TLS cached pointer を返す + - 例(概略): + - `static __thread const wrapper_env_cfg_t* t = NULL; if (!t) t = wrapper_env_cfg(); return t;` + +### Patch D2-3: wrapper 統合(2 箇所だけ) + +- `core/box/hak_wrappers.inc.h` + - `malloc()` / `free()` の hot path 冒頭の `wrapper_env_cfg()` を `wrapper_env_cfg_fast()` に置換 + - cold 側(`malloc_cold` / `free_cold`)は変更不要(差分最小) + +## A/B(GO/NO-GO) + +テスト: +- Mixed: `HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE`、10-run +- 比較: + - `HAKMEM_WRAP_ENV_CACHE=0`(baseline) + - `HAKMEM_WRAP_ENV_CACHE=1`(optimized) + +判定(10-run mean): +- GO: **+1.0% 以上** +- NO-GO: **-1.0% 以下** +- ±1.0%: NEUTRAL(研究箱維持、default OFF) + +注意: +- できれば iter を 20M にしてノイズを下げる(`./bench_random_mixed_hakmem 20000000 400 1`) + +## リスク + +- 低(pointer cache は refresh と競合しない) +- ただし multi-thread 初回アクセスで TLS 初期化が走るため、最初の数回は誤差に乗る + +## Rollback + +- `HAKMEM_WRAP_ENV_CACHE=0` で即 OFF +- 実装は既存 `wrapper_env_box` を汚さず、別箱で合成する + diff --git a/docs/analysis/PHASE3_D3_ALLOC_GATE_SPECIALIZATION_1_DESIGN.md b/docs/analysis/PHASE3_D3_ALLOC_GATE_SPECIALIZATION_1_DESIGN.md new file mode 100644 index 00000000..8adbe880 --- /dev/null +++ b/docs/analysis/PHASE3_D3_ALLOC_GATE_SPECIALIZATION_1_DESIGN.md @@ -0,0 +1,87 @@ +# Phase 3 D3: Alloc Gate Specialization(Mixed “LEGACY-only” 最短化)設計メモ + +## 目的 + +Mixed 本線(`MIXED_TINYV3_C7_SAFE`)では、 +構成が固定されているため「毎回の gate 判定」をさらに削れる余地がある。 + +この D3 は `tiny_alloc_gate_fast()` の分岐を “Mixed に特化した形” にして、 +alloc 入口の命令数と分岐を 1–2% 詰めることを狙う。 + +## 前提(Mixed 本線の固定事項) + +- `HAKMEM_MID_V3_ENABLED=0`(C6 を MID に送らない) +- `HAKMEM_TINY_STATIC_ROUTE=1`(policy_snapshot bypass) +- `HAKMEM_TINY_ALLOC_ROUTE_SHAPE=1`(alloc dispatch 形最適化) +- Tiny front v3 + LUT + fast classify は ON(既定) + +## 非目標 + +- ルーティングポリシーの意味変更(ULTRA/MID/V7/LEGACY の優先順位は変えない) +- サイズ→クラス変換の SSOT を壊す +- allocator のアルゴリズム変更(形の削減のみ) + +## Box Theory(箱割り) + +### L0: Env(戻せる) + +- ENV gate: `HAKMEM_ALLOC_GATE_LEGACY_ONLY=0/1`(default: 0) +- 目的: Mixed 本線だけで A/B → 勝てなければ即 OFF + +### L1: AllocGateLegacyOnlyBox(境界: alloc gate 入口 1箇所) + +責務: +- `tiny_alloc_gate_fast()` のうち “Mixed 本線で常に同じ結果になる分岐” を削って、 + `malloc_tiny_fast_for_class()` への最短経路を作る。 + +安全フェンス(必須): +- 初回に 1 回だけ “本当に LEGACY-only か” を確認してから有効化する。 + - 例: `small_policy_v7_init_from_env(&tmp)` で route_kind が LEGACY 以外を含むなら自動 disable + - Learner 有効時は自動 disable(route が動的に変わる) + +## 実装指示(小パッチ) + +### Patch D3-1: ENV gate + “safe enable” 判定 + +- 新規: `core/box/alloc_gate_legacy_only_box.h/.c` + - `alloc_gate_legacy_only_enabled_fast()`(hot path 用: boolean) + - 初期化境界 1 箇所: + - `small_policy_v7_init_from_env(&tmp)` で route_kind を検査 + - `tmp.route_kind[i] != SMALL_ROUTE_LEGACY` が存在したら disable + - learner ON のときも disable + - A/B で ON のときだけ有効になるようにする + +### Patch D3-2: `tiny_alloc_gate_fast()` 統合(差し替え 1 箇所) + +- `core/box/tiny_alloc_gate_box.h` + - `TinyRoutePolicy` の分岐を “Mixed では常に同じ” に寄せる(ただし fence を守る) + - 形の例(概略): + - `if (alloc_gate_legacy_only_enabled_fast()) { return malloc_tiny_fast_for_class(size, class_idx); }` + - それ以外は現行の gate ロジックを維持 + +注意: +- `tiny_alloc_gate_fast` は「Tiny を使うか/Pool へ逃がすか」の境界なので、 + “gate の意味” を変えない。削れるのは **分岐の形だけ**。 + +## A/B(GO/NO-GO) + +Mixed 10-run(推奨: 20M iters): +- baseline: `HAKMEM_ALLOC_GATE_LEGACY_ONLY=0` +- opt: `HAKMEM_ALLOC_GATE_LEGACY_ONLY=1` + +判定(10-run mean): +- GO: **+1.0% 以上** +- NO-GO: **-1.0% 以下** +- ±1.0%: NEUTRAL(研究箱維持、default OFF) + +## リスク + +- 低〜中 + - Mixed 本線に限定すれば低い + - “safe enable 判定” を入れないと、ENV 組み合わせで破綻するリスクが上がる + +## Rollback + +- `HAKMEM_ALLOC_GATE_LEGACY_ONLY=0`(即 OFF) +- 箱は独立させ、既存 gate を汚さない(境界 1 箇所差し替え) + diff --git a/hakmem.d b/hakmem.d index 17c4c5d5..16f40684 100644 --- a/hakmem.d +++ b/hakmem.d @@ -15,14 +15,18 @@ hakmem.o: core/hakmem.c core/hakmem.h core/hakmem_build_flags.h \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/tiny_remote.h core/hakmem_tiny_superslab_constants.h \ core/tiny_fastcache.h core/hakmem_env_cache.h \ core/box/tiny_next_ptr_box.h core/hakmem_tiny_config.h \ core/tiny_nextptr.h core/tiny_region_id.h core/tiny_box_geometry.h \ core/ptr_track.h core/tiny_debug_api.h core/box/tiny_layout_box.h \ - core/box/../hakmem_tiny_config.h core/box/tiny_header_box.h \ - core/box/../hakmem_build_flags.h core/box/tiny_layout_box.h \ + core/box/../hakmem_tiny_config.h core/box/../hakmem_build_flags.h \ + core/box/tiny_header_box.h core/box/tiny_layout_box.h \ core/box/../tiny_region_id.h core/hakmem_elo.h core/hakmem_ace_stats.h \ core/hakmem_batch.h core/hakmem_evo.h core/hakmem_debug.h \ core/hakmem_prof.h core/hakmem_syscall.h core/hakmem_ace_controller.h \ @@ -94,12 +98,13 @@ hakmem.o: core/hakmem.c core/hakmem.h core/hakmem_build_flags.h \ core/box/../front/../box/tiny_front_config_box.h \ core/box/../front/../box/../hakmem_build_flags.h \ core/box/../front/../tiny_region_id.h core/box/../front/../hakmem_tiny.h \ + core/box/../front/../box/tiny_env_box.h \ core/box/../front/../box/tiny_front_hot_box.h \ core/box/../front/../box/../hakmem_tiny_config.h \ core/box/../front/../box/../tiny_region_id.h \ core/box/../front/../box/../front/tiny_unified_cache.h \ - core/box/../front/../box/tiny_layout_box.h \ core/box/../front/../box/tiny_front_cold_box.h \ + core/box/../front/../box/tiny_layout_box.h \ core/box/../front/../box/tiny_hotheap_v2_box.h \ core/box/../front/../box/smallobject_hotbox_v3_box.h \ core/box/../front/../box/tiny_geometry_box.h \ @@ -118,6 +123,8 @@ hakmem.o: core/hakmem.c core/hakmem.h core/hakmem_build_flags.h \ core/box/../front/../box/region_id_v6_box.h \ core/box/../front/../box/smallobject_policy_v7_box.h \ core/box/../front/../box/smallobject_learner_v7_box.h \ + core/box/../front/../box/tiny_static_route_box.h \ + core/box/../front/../box/smallobject_policy_v7_box.h \ core/box/../front/../box/smallobject_mid_v35_box.h \ core/box/../front/../box/tiny_c7_ultra_box.h \ core/box/../front/../box/tiny_c7_ultra_segment_box.h \ @@ -130,16 +137,24 @@ hakmem.o: core/hakmem.c core/hakmem.h core/hakmem_build_flags.h \ core/box/../front/../box/tiny_ultra_tls_box.h \ core/box/../front/../box/tiny_ultra_classes_box.h \ core/box/../front/../box/tiny_legacy_fallback_box.h \ + core/box/../front/../box/../front/tiny_first_page_cache.h \ + core/box/../front/../box/../front/../hakmem_tiny_config.h \ core/box/../front/../box/tiny_front_v3_env_box.h \ core/box/../front/../box/free_path_stats_box.h \ core/box/../front/../box/tiny_front_hot_box.h \ + core/box/../front/../box/tiny_metadata_cache_env_box.h \ core/box/../front/../box/tiny_ptr_convert_box.h \ core/box/../front/../box/tiny_front_stats_box.h \ core/box/../front/../box/free_path_stats_box.h \ core/box/../front/../box/alloc_gate_stats_box.h \ core/box/../front/../box/free_policy_fast_v2_box.h \ + core/box/../front/../box/free_tiny_fast_hotcold_env_box.h \ + core/box/../front/../box/free_tiny_fast_hotcold_stats_box.h \ + core/box/../front/../box/tiny_metadata_cache_hot_box.h \ + core/box/../front/../box/tiny_free_route_cache_env_box.h \ core/box/tiny_alloc_gate_box.h core/box/tiny_route_box.h \ core/box/tiny_front_config_box.h core/box/wrapper_env_box.h \ + core/box/wrapper_env_cache_box.h core/box/wrapper_env_cache_env_box.h \ core/box/../hakmem_internal.h core/hakmem.h: core/hakmem_build_flags.h: @@ -174,6 +189,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/tiny_remote.h: core/hakmem_tiny_superslab_constants.h: @@ -188,8 +207,8 @@ core/ptr_track.h: core/tiny_debug_api.h: core/box/tiny_layout_box.h: core/box/../hakmem_tiny_config.h: -core/box/tiny_header_box.h: core/box/../hakmem_build_flags.h: +core/box/tiny_header_box.h: core/box/tiny_layout_box.h: core/box/../tiny_region_id.h: core/hakmem_elo.h: @@ -312,12 +331,13 @@ core/box/../front/../box/tiny_front_config_box.h: core/box/../front/../box/../hakmem_build_flags.h: core/box/../front/../tiny_region_id.h: core/box/../front/../hakmem_tiny.h: +core/box/../front/../box/tiny_env_box.h: core/box/../front/../box/tiny_front_hot_box.h: core/box/../front/../box/../hakmem_tiny_config.h: core/box/../front/../box/../tiny_region_id.h: core/box/../front/../box/../front/tiny_unified_cache.h: -core/box/../front/../box/tiny_layout_box.h: core/box/../front/../box/tiny_front_cold_box.h: +core/box/../front/../box/tiny_layout_box.h: core/box/../front/../box/tiny_hotheap_v2_box.h: core/box/../front/../box/smallobject_hotbox_v3_box.h: core/box/../front/../box/tiny_geometry_box.h: @@ -336,6 +356,8 @@ core/box/../front/../box/smallobject_cold_iface_v7_box.h: core/box/../front/../box/region_id_v6_box.h: core/box/../front/../box/smallobject_policy_v7_box.h: core/box/../front/../box/smallobject_learner_v7_box.h: +core/box/../front/../box/tiny_static_route_box.h: +core/box/../front/../box/smallobject_policy_v7_box.h: core/box/../front/../box/smallobject_mid_v35_box.h: core/box/../front/../box/tiny_c7_ultra_box.h: core/box/../front/../box/tiny_c7_ultra_segment_box.h: @@ -348,16 +370,25 @@ core/box/../front/../box/tiny_c4_ultra_free_env_box.h: core/box/../front/../box/tiny_ultra_tls_box.h: core/box/../front/../box/tiny_ultra_classes_box.h: core/box/../front/../box/tiny_legacy_fallback_box.h: +core/box/../front/../box/../front/tiny_first_page_cache.h: +core/box/../front/../box/../front/../hakmem_tiny_config.h: core/box/../front/../box/tiny_front_v3_env_box.h: core/box/../front/../box/free_path_stats_box.h: core/box/../front/../box/tiny_front_hot_box.h: +core/box/../front/../box/tiny_metadata_cache_env_box.h: core/box/../front/../box/tiny_ptr_convert_box.h: core/box/../front/../box/tiny_front_stats_box.h: core/box/../front/../box/free_path_stats_box.h: core/box/../front/../box/alloc_gate_stats_box.h: core/box/../front/../box/free_policy_fast_v2_box.h: +core/box/../front/../box/free_tiny_fast_hotcold_env_box.h: +core/box/../front/../box/free_tiny_fast_hotcold_stats_box.h: +core/box/../front/../box/tiny_metadata_cache_hot_box.h: +core/box/../front/../box/tiny_free_route_cache_env_box.h: core/box/tiny_alloc_gate_box.h: core/box/tiny_route_box.h: core/box/tiny_front_config_box.h: core/box/wrapper_env_box.h: +core/box/wrapper_env_cache_box.h: +core/box/wrapper_env_cache_env_box.h: core/box/../hakmem_internal.h: diff --git a/hakmem_learner.d b/hakmem_learner.d index b99a3fad..d3866c34 100644 --- a/hakmem_learner.d +++ b/hakmem_learner.d @@ -14,7 +14,11 @@ hakmem_learner.o: core/hakmem_learner.c core/hakmem_learner.h \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/tiny_remote.h core/hakmem_tiny_superslab_constants.h \ core/box/learner_env_box.h core/box/../hakmem_config.h core/hakmem_learner.h: @@ -47,6 +51,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/tiny_remote.h: core/hakmem_tiny_superslab_constants.h: diff --git a/hakmem_pool.d b/hakmem_pool.d index 15e96d82..0e752ab3 100644 --- a/hakmem_pool.d +++ b/hakmem_pool.d @@ -13,7 +13,19 @@ hakmem_pool.o: core/hakmem_pool.c core/hakmem_pool.h \ core/box/pool_init_api.inc.h core/box/pool_stats.inc.h \ core/box/pool_api.inc.h core/box/pagefault_telemetry_box.h \ core/box/pool_hotbox_v2_box.h core/box/tiny_heap_env_box.h \ - core/box/c7_hotpath_env_box.h core/box/pool_zero_mode_box.h + core/box/c7_hotpath_env_box.h core/box/pool_zero_mode_box.h \ + core/box/pool_config_box.h core/box/pool_stats_box.h \ + core/box/pool_config_box.h core/box/pool_mid_desc_cache_box.h \ + core/box/pool_free_v1_box.h core/box/pool_stats_box.h \ + core/box/pool_mid_desc_cache_box.h \ + core/box/pool_mid_inuse_deferred_box.h \ + core/box/pool_mid_inuse_deferred_env_box.h \ + core/box/pool_mid_inuse_tls_pagemap_box.h \ + core/box/pool_mid_inuse_deferred_stats_box.h \ + core/box/pool_block_to_user_box.h core/box/pool_free_v2_box.h \ + core/box/pool_block_to_user_box.h core/box/pool_hotbox_v2_box.h \ + core/box/pool_alloc_v1_flat_box.h core/box/pool_alloc_v2_box.h \ + core/box/pool_alloc_v1_box.h core/hakmem_pool.h: core/box/hak_lane_classify.inc.h: core/hakmem_config.h: @@ -49,3 +61,21 @@ core/box/pool_hotbox_v2_box.h: core/box/tiny_heap_env_box.h: core/box/c7_hotpath_env_box.h: core/box/pool_zero_mode_box.h: +core/box/pool_config_box.h: +core/box/pool_stats_box.h: +core/box/pool_config_box.h: +core/box/pool_mid_desc_cache_box.h: +core/box/pool_free_v1_box.h: +core/box/pool_stats_box.h: +core/box/pool_mid_desc_cache_box.h: +core/box/pool_mid_inuse_deferred_box.h: +core/box/pool_mid_inuse_deferred_env_box.h: +core/box/pool_mid_inuse_tls_pagemap_box.h: +core/box/pool_mid_inuse_deferred_stats_box.h: +core/box/pool_block_to_user_box.h: +core/box/pool_free_v2_box.h: +core/box/pool_block_to_user_box.h: +core/box/pool_hotbox_v2_box.h: +core/box/pool_alloc_v1_flat_box.h: +core/box/pool_alloc_v2_box.h: +core/box/pool_alloc_v1_box.h: diff --git a/hakmem_shared_pool.d b/hakmem_shared_pool.d index 27845403..8c7e6092 100644 --- a/hakmem_shared_pool.d +++ b/hakmem_shared_pool.d @@ -9,7 +9,11 @@ hakmem_shared_pool.o: core/hakmem_shared_pool.c \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/hakmem_build_flags.h core/tiny_remote.h \ core/hakmem_tiny_superslab_constants.h core/hakmem_debug_master.h \ core/hakmem_stats_master.h core/box/ss_slab_meta_box.h \ @@ -19,8 +23,8 @@ hakmem_shared_pool.o: core/hakmem_shared_pool.c \ core/ptr_track.h core/hakmem_tiny.h core/hakmem_trace.h \ core/hakmem_tiny_mini_mag.h core/box/hak_lane_classify.inc.h \ core/box/ptr_type_box.h core/tiny_debug_api.h core/box/tiny_layout_box.h \ - core/box/../hakmem_tiny_config.h core/box/tiny_header_box.h \ - core/box/../hakmem_build_flags.h core/box/tiny_layout_box.h \ + core/box/../hakmem_tiny_config.h core/box/../hakmem_build_flags.h \ + core/box/tiny_header_box.h core/box/tiny_layout_box.h \ core/box/../tiny_region_id.h core/box/ss_hot_cold_box.h \ core/box/pagefault_telemetry_box.h core/box/tls_sll_drain_box.h \ core/box/tls_sll_box.h core/box/../hakmem_internal.h \ @@ -63,6 +67,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/hakmem_build_flags.h: core/tiny_remote.h: @@ -86,8 +94,8 @@ core/box/ptr_type_box.h: core/tiny_debug_api.h: core/box/tiny_layout_box.h: core/box/../hakmem_tiny_config.h: -core/box/tiny_header_box.h: core/box/../hakmem_build_flags.h: +core/box/tiny_header_box.h: core/box/tiny_layout_box.h: core/box/../tiny_region_id.h: core/box/ss_hot_cold_box.h: diff --git a/hakmem_super_registry.d b/hakmem_super_registry.d index 3f200f96..a1d9a65b 100644 --- a/hakmem_super_registry.d +++ b/hakmem_super_registry.d @@ -8,8 +8,11 @@ hakmem_super_registry.o: core/hakmem_super_registry.c \ core/hakmem_build_flags.h core/tiny_remote.h \ core/hakmem_tiny_superslab_constants.h core/box/ss_addr_map_box.h \ core/box/../hakmem_build_flags.h core/box/super_reg_box.h \ + core/box/ss_pt_lookup_box.h core/box/ss_pt_types_box.h \ + core/box/ss_pt_env_box.h core/box/ss_pt_env_box.h \ core/box/ss_allocation_box.h core/hakmem_tiny_superslab.h \ - core/box/ss_cold_start_box.inc.h core/hakmem_env_cache.h + core/box/ss_cold_start_box.inc.h core/hakmem_env_cache.h \ + core/box/ss_pt_register_box.h core/hakmem_super_registry.h: core/hakmem_tiny_superslab.h: core/superslab/superslab_types.h: @@ -26,7 +29,12 @@ core/hakmem_tiny_superslab_constants.h: core/box/ss_addr_map_box.h: core/box/../hakmem_build_flags.h: core/box/super_reg_box.h: +core/box/ss_pt_lookup_box.h: +core/box/ss_pt_types_box.h: +core/box/ss_pt_env_box.h: +core/box/ss_pt_env_box.h: core/box/ss_allocation_box.h: core/hakmem_tiny_superslab.h: core/box/ss_cold_start_box.inc.h: core/hakmem_env_cache.h: +core/box/ss_pt_register_box.h: diff --git a/hakmem_tiny_bg_spill.d b/hakmem_tiny_bg_spill.d index 6c284d90..9b9eb0ed 100644 --- a/hakmem_tiny_bg_spill.d +++ b/hakmem_tiny_bg_spill.d @@ -9,7 +9,9 @@ hakmem_tiny_bg_spill.o: core/hakmem_tiny_bg_spill.c \ core/superslab/superslab_types.h core/superslab/../tiny_box_geometry.h \ core/tiny_debug_ring.h core/tiny_remote.h core/box/ss_addr_map_box.h \ core/box/../hakmem_build_flags.h core/box/super_reg_box.h \ - core/hakmem_tiny.h core/hakmem_trace.h core/hakmem_tiny_mini_mag.h \ + core/box/ss_pt_lookup_box.h core/box/ss_pt_types_box.h \ + core/box/ss_pt_env_box.h core/box/ss_pt_env_box.h core/hakmem_tiny.h \ + core/hakmem_trace.h core/hakmem_tiny_mini_mag.h \ core/box/hak_lane_classify.inc.h core/box/ptr_type_box.h \ core/tiny_debug_api.h core/box/tiny_layout_box.h \ core/box/../hakmem_tiny_config.h core/box/tiny_header_box.h \ @@ -36,6 +38,10 @@ core/tiny_remote.h: core/box/ss_addr_map_box.h: core/box/../hakmem_build_flags.h: core/box/super_reg_box.h: +core/box/ss_pt_lookup_box.h: +core/box/ss_pt_types_box.h: +core/box/ss_pt_env_box.h: +core/box/ss_pt_env_box.h: core/hakmem_tiny.h: core/hakmem_trace.h: core/hakmem_tiny_mini_mag.h: diff --git a/hakmem_tiny_magazine.d b/hakmem_tiny_magazine.d index 8adea833..10858de4 100644 --- a/hakmem_tiny_magazine.d +++ b/hakmem_tiny_magazine.d @@ -12,7 +12,11 @@ hakmem_tiny_magazine.o: core/hakmem_tiny_magazine.c \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/tiny_remote.h core/hakmem_tiny_superslab_constants.h \ core/hakmem_prof.h core/hakmem_internal.h core/hakmem.h \ core/hakmem_config.h core/hakmem_features.h core/hakmem_sys.h \ @@ -20,7 +24,7 @@ hakmem_tiny_magazine.o: core/hakmem_tiny_magazine.c \ core/hakmem_tiny_config.h core/tiny_nextptr.h core/tiny_region_id.h \ core/tiny_box_geometry.h core/ptr_track.h core/tiny_debug_api.h \ core/box/tiny_layout_box.h core/box/../hakmem_tiny_config.h \ - core/box/tiny_header_box.h core/box/../hakmem_build_flags.h \ + core/box/../hakmem_build_flags.h core/box/tiny_header_box.h \ core/box/tiny_layout_box.h core/box/../tiny_region_id.h \ core/box/tiny_mem_stats_box.h core/hakmem_tiny_magazine.h: @@ -44,6 +48,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/tiny_remote.h: core/hakmem_tiny_superslab_constants.h: @@ -63,8 +71,8 @@ core/ptr_track.h: core/tiny_debug_api.h: core/box/tiny_layout_box.h: core/box/../hakmem_tiny_config.h: -core/box/tiny_header_box.h: core/box/../hakmem_build_flags.h: +core/box/tiny_header_box.h: core/box/tiny_layout_box.h: core/box/../tiny_region_id.h: core/box/tiny_mem_stats_box.h: diff --git a/hakmem_tiny_query.d b/hakmem_tiny_query.d index 01758b49..2e09dd69 100644 --- a/hakmem_tiny_query.d +++ b/hakmem_tiny_query.d @@ -12,7 +12,11 @@ hakmem_tiny_query.o: core/hakmem_tiny_query.c core/hakmem_tiny.h \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/tiny_remote.h core/hakmem_tiny_superslab_constants.h \ core/hakmem_config.h core/hakmem_features.h core/hakmem_tiny.h: @@ -36,6 +40,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/tiny_remote.h: core/hakmem_tiny_superslab_constants.h: diff --git a/hakmem_tiny_sfc.d b/hakmem_tiny_sfc.d index 06bb3425..ee9a4559 100644 --- a/hakmem_tiny_sfc.d +++ b/hakmem_tiny_sfc.d @@ -10,20 +10,22 @@ hakmem_tiny_sfc.o: core/hakmem_tiny_sfc.c core/tiny_alloc_fast_sfc.inc.h \ core/superslab/superslab_types.h core/superslab/../tiny_box_geometry.h \ core/tiny_debug_ring.h core/tiny_remote.h core/box/ss_addr_map_box.h \ core/box/../hakmem_build_flags.h core/box/super_reg_box.h \ - core/tiny_debug_api.h core/box/tiny_layout_box.h \ - core/box/../hakmem_tiny_config.h core/box/tiny_header_box.h \ - core/box/tiny_layout_box.h core/box/../tiny_region_id.h \ - core/hakmem_stats_master.h core/tiny_tls.h core/box/tls_sll_box.h \ - core/box/../hakmem_internal.h core/box/../hakmem.h \ - core/box/../hakmem_build_flags.h core/box/../hakmem_config.h \ - core/box/../hakmem_features.h core/box/../hakmem_sys.h \ - core/box/../hakmem_whale.h core/box/../box/ptr_type_box.h \ - core/box/../hakmem_debug_master.h core/box/../tiny_remote.h \ - core/box/../hakmem_tiny_integrity.h core/box/../hakmem_tiny.h \ - core/box/../ptr_track.h core/box/../ptr_trace.h \ - core/box/../hakmem_trace_master.h core/box/../hakmem_stats_master.h \ - core/box/../tiny_debug_ring.h core/box/ss_addr_map_box.h \ - core/box/../superslab/superslab_inline.h core/box/tiny_ptr_bridge_box.h \ + core/box/ss_pt_lookup_box.h core/box/ss_pt_types_box.h \ + core/box/ss_pt_env_box.h core/box/ss_pt_env_box.h core/tiny_debug_api.h \ + core/box/tiny_layout_box.h core/box/../hakmem_tiny_config.h \ + core/box/tiny_header_box.h core/box/tiny_layout_box.h \ + core/box/../tiny_region_id.h core/hakmem_stats_master.h core/tiny_tls.h \ + core/box/tls_sll_box.h core/box/../hakmem_internal.h \ + core/box/../hakmem.h core/box/../hakmem_build_flags.h \ + core/box/../hakmem_config.h core/box/../hakmem_features.h \ + core/box/../hakmem_sys.h core/box/../hakmem_whale.h \ + core/box/../box/ptr_type_box.h core/box/../hakmem_debug_master.h \ + core/box/../tiny_remote.h core/box/../hakmem_tiny_integrity.h \ + core/box/../hakmem_tiny.h core/box/../ptr_track.h \ + core/box/../ptr_trace.h core/box/../hakmem_trace_master.h \ + core/box/../hakmem_stats_master.h core/box/../tiny_debug_ring.h \ + core/box/ss_addr_map_box.h core/box/../superslab/superslab_inline.h \ + core/box/tiny_ptr_bridge_box.h \ core/box/../hakmem_tiny_superslab_internal.h \ core/box/../hakmem_tiny_superslab.h core/box/../box/ss_hot_cold_box.h \ core/box/../box/../superslab/superslab_types.h \ @@ -62,6 +64,10 @@ core/tiny_remote.h: core/box/ss_addr_map_box.h: core/box/../hakmem_build_flags.h: core/box/super_reg_box.h: +core/box/ss_pt_lookup_box.h: +core/box/ss_pt_types_box.h: +core/box/ss_pt_env_box.h: +core/box/ss_pt_env_box.h: core/tiny_debug_api.h: core/box/tiny_layout_box.h: core/box/../hakmem_tiny_config.h: diff --git a/hakmem_tiny_stats.d b/hakmem_tiny_stats.d index bcaf4a80..916cdedf 100644 --- a/hakmem_tiny_stats.d +++ b/hakmem_tiny_stats.d @@ -12,7 +12,11 @@ hakmem_tiny_stats.o: core/hakmem_tiny_stats.c core/hakmem_tiny.h \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/tiny_remote.h core/hakmem_tiny_superslab_constants.h \ core/hakmem_config.h core/hakmem_features.h core/hakmem_tiny_stats.h core/hakmem_tiny.h: @@ -37,6 +41,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/tiny_remote.h: core/hakmem_tiny_superslab_constants.h: diff --git a/tiny_adaptive_sizing.d b/tiny_adaptive_sizing.d index c9fde647..b0e49a3b 100644 --- a/tiny_adaptive_sizing.d +++ b/tiny_adaptive_sizing.d @@ -11,9 +11,11 @@ tiny_adaptive_sizing.o: core/tiny_adaptive_sizing.c \ core/superslab/superslab_types.h core/superslab/../tiny_box_geometry.h \ core/tiny_debug_ring.h core/tiny_remote.h core/box/ss_addr_map_box.h \ core/box/../hakmem_build_flags.h core/box/super_reg_box.h \ - core/tiny_debug_api.h core/box/tiny_layout_box.h \ - core/box/../hakmem_tiny_config.h core/box/tiny_header_box.h \ - core/box/tiny_layout_box.h core/box/../tiny_region_id.h + core/box/ss_pt_lookup_box.h core/box/ss_pt_types_box.h \ + core/box/ss_pt_env_box.h core/box/ss_pt_env_box.h core/tiny_debug_api.h \ + core/box/tiny_layout_box.h core/box/../hakmem_tiny_config.h \ + core/box/tiny_header_box.h core/box/tiny_layout_box.h \ + core/box/../tiny_region_id.h core/tiny_adaptive_sizing.h: core/hakmem_tiny.h: core/hakmem_build_flags.h: @@ -41,6 +43,10 @@ core/tiny_remote.h: core/box/ss_addr_map_box.h: core/box/../hakmem_build_flags.h: core/box/super_reg_box.h: +core/box/ss_pt_lookup_box.h: +core/box/ss_pt_types_box.h: +core/box/ss_pt_env_box.h: +core/box/ss_pt_env_box.h: core/tiny_debug_api.h: core/box/tiny_layout_box.h: core/box/../hakmem_tiny_config.h: diff --git a/tiny_fastcache.d b/tiny_fastcache.d index 4535048f..13834266 100644 --- a/tiny_fastcache.d +++ b/tiny_fastcache.d @@ -9,7 +9,9 @@ tiny_fastcache.o: core/tiny_fastcache.c core/tiny_fastcache.h \ core/superslab/superslab_types.h core/superslab/../tiny_box_geometry.h \ core/tiny_debug_ring.h core/tiny_remote.h core/box/ss_addr_map_box.h \ core/box/../hakmem_build_flags.h core/box/super_reg_box.h \ - core/hakmem_tiny.h core/hakmem_trace.h core/hakmem_tiny_mini_mag.h \ + core/box/ss_pt_lookup_box.h core/box/ss_pt_types_box.h \ + core/box/ss_pt_env_box.h core/box/ss_pt_env_box.h core/hakmem_tiny.h \ + core/hakmem_trace.h core/hakmem_tiny_mini_mag.h \ core/box/hak_lane_classify.inc.h core/box/ptr_type_box.h \ core/tiny_debug_api.h core/box/tiny_layout_box.h \ core/box/../hakmem_tiny_config.h core/box/tiny_header_box.h \ @@ -37,6 +39,10 @@ core/tiny_remote.h: core/box/ss_addr_map_box.h: core/box/../hakmem_build_flags.h: core/box/super_reg_box.h: +core/box/ss_pt_lookup_box.h: +core/box/ss_pt_types_box.h: +core/box/ss_pt_env_box.h: +core/box/ss_pt_env_box.h: core/hakmem_tiny.h: core/hakmem_trace.h: core/hakmem_tiny_mini_mag.h: diff --git a/tiny_publish.d b/tiny_publish.d index 126a6ca9..42f32be4 100644 --- a/tiny_publish.d +++ b/tiny_publish.d @@ -11,7 +11,11 @@ tiny_publish.o: core/tiny_publish.c core/hakmem_tiny.h \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/tiny_remote.h core/hakmem_tiny_superslab_constants.h \ core/tiny_publish.h core/hakmem_tiny_superslab.h \ core/hakmem_tiny_stats_api.h core/hakmem_trace_master.h @@ -35,6 +39,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/tiny_remote.h: core/hakmem_tiny_superslab_constants.h: diff --git a/tiny_remote.d b/tiny_remote.d index bf89846c..bc3524da 100644 --- a/tiny_remote.d +++ b/tiny_remote.d @@ -9,7 +9,11 @@ tiny_remote.o: core/tiny_remote.c core/tiny_remote.h \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/hakmem_build_flags.h core/hakmem_tiny_superslab_constants.h core/tiny_remote.h: core/box/remote_side_box.h: @@ -26,6 +30,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/hakmem_build_flags.h: core/hakmem_tiny_superslab_constants.h: diff --git a/tiny_sticky.d b/tiny_sticky.d index b77189f9..8500a282 100644 --- a/tiny_sticky.d +++ b/tiny_sticky.d @@ -11,7 +11,11 @@ tiny_sticky.o: core/tiny_sticky.c core/hakmem_tiny.h \ core/superslab/../hakmem_tiny_superslab.h \ core/superslab/../box/ss_addr_map_box.h \ core/superslab/../box/../hakmem_build_flags.h \ - core/superslab/../box/super_reg_box.h core/tiny_debug_ring.h \ + core/superslab/../box/super_reg_box.h \ + core/superslab/../box/ss_pt_lookup_box.h \ + core/superslab/../box/ss_pt_types_box.h \ + core/superslab/../box/ss_pt_env_box.h \ + core/superslab/../box/ss_pt_env_box.h core/tiny_debug_ring.h \ core/tiny_remote.h core/hakmem_tiny_superslab_constants.h core/hakmem_tiny.h: core/hakmem_build_flags.h: @@ -33,6 +37,10 @@ core/superslab/../hakmem_tiny_superslab.h: core/superslab/../box/ss_addr_map_box.h: core/superslab/../box/../hakmem_build_flags.h: core/superslab/../box/super_reg_box.h: +core/superslab/../box/ss_pt_lookup_box.h: +core/superslab/../box/ss_pt_types_box.h: +core/superslab/../box/ss_pt_env_box.h: +core/superslab/../box/ss_pt_env_box.h: core/tiny_debug_ring.h: core/tiny_remote.h: core/hakmem_tiny_superslab_constants.h: