Files
hakmem/core/box/learner_env_box.h
Moe Charm (CI) 84f5034e45 Phase 68: PGO training set diversification (seed/WS expansion)
Changes:
- scripts/box/pgo_fast_profile_config.sh: Expanded WS patterns (3→5) and seeds (1→3)
  for reduced overfitting and better production workload representativeness
- PERFORMANCE_TARGETS_SCORECARD.md: Phase 68 baseline promoted (61.614M = 50.93%)
- CURRENT_TASK.md: Phase 68 marked complete, Phase 67a (layout tax forensics) set Active

Results:
- 10-run verification: +1.19% vs Phase 66 baseline (GO, >+1.0% threshold)
- M1 milestone: 50.93% of mimalloc (target 50%, exceeded by +0.93pp)
- Stability: 10-run mean/median with <2.1% CV

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-17 21:08:17 +09:00

38 lines
1.2 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// learner_env_box.h - Learning Layer ENV Box
// Purpose: Decide whether CAP Learner thread should run, based on HAKMEM_MODE
// and HAKMEM_LEARN, without touchingホットパス。
//
// Priority:
// 1. HAKMEM_LEARN is set → 0/1 で明示的に上書き
// 2. 未設定の場合:
// HAKMEM_MODE=learning/research → Learner 有効
// それ以外minimal/fast/balanced → Learner 無効
#pragma once
#include "../hakmem_config.h"
#include "../hakmem_build_flags.h"
#include <stdlib.h>
static inline int hak_learner_env_should_run(void) {
#if HAKMEM_BENCH_MINIMAL || HAKMEM_FAST_PROFILE_FIXED || HAKMEM_FAST_PROFILE_PRUNE_BACKENDS
// Phase 63/64: Disable learning layer in FAST profile-fixed/pruned builds
return 0;
#endif
static int g_inited = 0;
static int g_effective = 0;
if (__builtin_expect(!g_inited, 0)) {
const char* e = getenv("HAKMEM_LEARN");
if (e && *e) {
int v = atoi(e);
g_effective = (v != 0) ? 1 : 0;
} else {
HakemMode m = g_hakem_config.mode;
g_effective =
(m == HAKMEM_MODE_LEARNING || m == HAKMEM_MODE_RESEARCH) ? 1 : 0;
}
g_inited = 1;
}
return g_effective;
}