release: silence runtime logs and stabilize benches

- Fix HAKMEM_LOG gating to use  (numeric) so release builds compile out logs.
- Switch remaining prints to HAKMEM_LOG or guard with :
  - core/box/hak_core_init.inc.h (EVO sample warning, shutdown banner)
  - core/hakmem_config.c (config/feature prints)
  - core/hakmem.c (BigCache eviction prints)
  - core/hakmem_tiny_superslab.c (OOM, head init/expand, C7 init diagnostics)
  - core/hakmem_elo.c (init/evolution)
  - core/hakmem_batch.c (init/flush/stats)
  - core/hakmem_ace.c (33KB route diagnostics)
  - core/hakmem_ace_controller.c (ACE logs macro → no-op in release)
  - core/hakmem_site_rules.c (init banner)
  - core/box/hak_free_api.inc.h (unknown method error → release-gated)
- Rebuilt benches and verified quiet output for release:
  - bench_fixed_size_hakmem/system
  - bench_random_mixed_hakmem/system
  - bench_mid_large_mt_hakmem/system
  - bench_comprehensive_hakmem/system

Note: Kept debug logs available in debug builds and when explicitly toggled via env.
This commit is contained in:
Moe Charm (CI)
2025-11-11 01:47:06 +09:00
parent a97005f50e
commit 8feeb63c2b
25 changed files with 215 additions and 144 deletions

View File

@ -71,10 +71,9 @@ void hak_elo_init(void) {
g_current_strategy = g_num_strategies / 2;
g_initialized = 1;
const char* q = getenv("HAKMEM_QUIET");
if (!(q && strcmp(q, "1") == 0)) {
fprintf(stderr, "[ELO] Initialized %d strategies (thresholds: 512KB-32MB)\n", g_num_strategies);
}
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[ELO] Initialized %d strategies (thresholds: 512KB-32MB)\n", g_num_strategies);
#endif
}
// Shutdown ELO system
@ -189,7 +188,9 @@ void hak_elo_update_ratings(EloStrategyCandidate* a, EloStrategyCandidate* b, do
void hak_elo_trigger_evolution(void) {
if (!g_initialized) return;
{ const char* q = getenv("HAKMEM_QUIET"); if (!(q && strcmp(q, "1") == 0)) fprintf(stderr, "[ELO] Triggering evolution (pairwise comparison)...\n"); }
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[ELO] Triggering evolution (pairwise comparison)...\n");
#endif
// Count active strategies with enough samples
int eligible[ELO_MAX_STRATEGIES];
@ -308,3 +309,5 @@ void hak_elo_print_leaderboard(void) {
s->active ? "ACTIVE" : "eliminated"); }
}
}
// Release-silent logging
#include "hakmem_internal.h"