Files
LithosAnanake/Kconfig.physics

221 lines
8.5 KiB
Plaintext

menu "Physics engine tuning"
config STRICT_PTR
bool "Strict pointer bounds checking (STRICT_PTR)"
default y
help
Enforces VM memory bounds checking on every pointer access.
Disable only for raw benchmarking comparisons.
config ENABLE_HOTWORDS_CACHE
bool "Physics-driven hot-words cache (ENABLE_HOTWORDS_CACHE)"
default n
help
1.78x speedup on dictionary lookups when enabled. Default is
off (n) -- this matches the Makefile's actual current default,
not the stale comment beside it that claims the opposite; that
comment/default mismatch is exactly the kind of drift this
migration exists to collapse to one source of truth. Set to y
to enable; also gates L8 Jacquard's L1_heat_tracking bit.
config ENABLE_PIPELINING
bool "Speculative execution via word transition prediction (ENABLE_PIPELINING)"
default n
help
Same default-vs-comment mismatch as ENABLE_HOTWORDS_CACHE above
-- actual current default is off (n). Also gates L8 Jacquard's
L4_pipelining bit. A 2025-11-19 note in the old Makefile says
future experiments use both this and the hot-words cache
enabled together.
config TRANSITION_WINDOW_SIZE
int "Pipelining context depth (TRANSITION_WINDOW_SIZE)"
depends on ENABLE_PIPELINING
default 8
help
Word-transition lookahead depth for pipelining prediction.
Only meaningful when ENABLE_PIPELINING is on.
physics_pipelining_metrics.h used to carry its own independent
fallback of 2, which turned out to be live (not just latent) for
kernel builds -- see rev v in
docs/working/architecture/VM-FLEET-ATTRACTOR-DESIGN-20260705.md.
Resolved in Phase 3: that header now includes starforth_config.h
instead of carrying its own copy.
config SPECULATION_THRESHOLD_Q48
hex "Minimum transition probability to speculate, Q48.16 (SPECULATION_THRESHOLD_Q48)"
depends on ENABLE_PIPELINING
default 0x8000
help
Minimum probability (Q48.16 fixed point) that a word transition
must reach before pipelining will speculate on it. Range 0.10
(aggressive) to 0.95 (conservative). Default 0x8000 = 0.50 in
Q48.16. Previously a hardcoded, non-overridable #define in
physics_pipelining_metrics.h; promoted to a real knob in Phase 5,
same treatment as Phase 3/4's previously-unwired constants.
config SPECULATION_DEPTH
int "Speculative prefetch depth, words ahead (SPECULATION_DEPTH)"
depends on ENABLE_PIPELINING
default 1
help
How many words ahead to prefetch speculatively. Range 1 (next
word only) to 4 (very aggressive). Previously unwired, same as
SPECULATION_THRESHOLD_Q48 above.
config MIN_SAMPLES_FOR_SPECULATION
int "Transitions observed before speculating (MIN_SAMPLES_FOR_SPECULATION)"
depends on ENABLE_PIPELINING
default 10
help
Minimum number of observed transitions before pipelining will
make a speculation decision for a word. Range 1 (immediate) to
100 (very conservative). Previously unwired, same as
SPECULATION_THRESHOLD_Q48 above.
config MISPREDICTION_COST_Q48
hex "Estimated misprediction recovery cost, ns, Q48.16 (MISPREDICTION_COST_Q48)"
depends on ENABLE_PIPELINING
default 0x190000
help
Estimated cost, in nanoseconds (Q48.16 fixed point), of recovering
from a wrong speculation -- calibrated to actual recovery time on
target hardware. Default 0x190000 = 25 ns in Q48.16. Previously
unwired, same as SPECULATION_THRESHOLD_Q48 above.
config MINIMUM_PREFETCH_ROI
hex "Minimum prefetch ROI ratio, Q48.16 (MINIMUM_PREFETCH_ROI)"
depends on ENABLE_PIPELINING
default 0x1199A
help
Minimum expected return-on-investment ratio for speculation to be
considered worthwhile. 1.10 in Q48.16 (10% expected improvement
threshold; 1.10 * 65536 = 72089.6, rounds to 0x1199A). Was shipped
for years as 0x11999A (an extra hex digit, ~17.6 in Q48.16, an
order of magnitude off from the documented 1.10 intent) -- found
while migrating this constant to Kconfig (Phase 5, rev x) and
fixed on Bob's explicit instruction (rev y).
config ROLLING_WINDOW_SIZE
int "Rolling window of truth: initial capacity (ROLLING_WINDOW_SIZE)"
default 4096
help
Initial execution-history capture size. The rolling window
automatically shrinks during execution if diminishing returns
are detected (see ADAPTIVE_* below).
config ADAPTIVE_SHRINK_RATE
int "Adaptive window shrink: retain percentage (ADAPTIVE_SHRINK_RATE)"
range 50 95
default 50
help
Percentage of the rolling window retained when an adaptive
shrink fires (discard the rest). Default here (50) matches the
Makefile; include/rolling_window_knobs.h has its own conflicting
fallback of 75 that Phase 3 resolves in favor of this value.
config ADAPTIVE_MIN_WINDOW_SIZE
int "Adaptive window shrink floor (ADAPTIVE_MIN_WINDOW_SIZE)"
default 256
help
Never shrink the rolling window below this many word IDs.
config ADAPTIVE_CHECK_FREQUENCY
int "Adaptive window: diversity check frequency (ADAPTIVE_CHECK_FREQUENCY)"
default 512
help
How often (in executions) to measure pattern diversity for the
adaptive shrink decision.
config ADAPTIVE_GROWTH_THRESHOLD
int "Adaptive window: saturation growth threshold percent (ADAPTIVE_GROWTH_THRESHOLD)"
range 0 10
default 5
help
Growth rate (percent) below which the window is considered
saturated and a shrink is considered.
config INITIAL_DECAY_SLOPE_Q48
int "Initial decay slope, Q48.16 fixed point (INITIAL_DECAY_SLOPE_Q48)"
default 21845
help
Cold-start seed for the adaptively-inferred decay slope
(21845 ~= 1/3 in Q48.16). The inference engine (Loop #6)
retunes this at runtime; this value only matters at boot.
config DECAY_MIN_INTERVAL
int "Minimum decay interval, nanoseconds (DECAY_MIN_INTERVAL)"
default 500
help
Historical minimum-real-time-gap gate for Loop #3 heat decay.
As of the tick-based decay conversion (see
docs/working/architecture/VM-FLEET-ATTRACTOR-DESIGN-20260705.md,
rev t), Loop #3 no longer consults this value at all -- decay
is gated on elapsed heartbeat ticks, not elapsed nanoseconds.
Kept only because doe_metrics.c still reports it as a metrics
field; informational, not load-bearing.
config DECAY_RATE_PER_US_Q16
int "Decay rate, Q16 fixed point per microsecond (DECAY_RATE_PER_US_Q16)"
default 1
help
Half-life is approximately 6.5 seconds at the default value of
1. Set to 0 to disable decay entirely (baseline comparison).
config HEARTBEAT_INFERENCE_FREQUENCY
int "Inference engine run frequency, ticks (HEARTBEAT_INFERENCE_FREQUENCY)"
default 1000
help
How many heartbeat ticks between inference engine runs (window
width + decay slope re-inference). Set very high (e.g. 999999)
to effectively disable inference for a static-configuration run.
comment "L8 Jacquard mode selector (SSM_* thresholds, ssm_jacquard.h)"
config SSM_ENTROPY_HIGH_THRESHOLD
string "Entropy threshold that enables L2 diversity tracking (SSM_ENTROPY_HIGH_THRESHOLD)"
default "0.75"
help
Rolling-window entropy above this value (0.0-1.0) votes to enable
Loop #2 (diversity). Previously unwired -- ssm_jacquard.h's own
#ifndef fallback was the only place this value lived; no Makefile
knob or -D forwarding existed for it before this migration. String
type because Kconfig has no native float symbol type; auto.conf
writes string defaults unquoted, so this reaches the C side as a
bare floating-point literal exactly as ssm_jacquard.h expects.
config SSM_CV_HIGH_THRESHOLD
string "Coefficient-of-variation threshold that enables L5/L6 inference (SSM_CV_HIGH_THRESHOLD)"
default "0.15"
help
Short-term volatility above this value votes to enable Loops #5/#6
(window width + decay slope inference). Previously unwired, same
as SSM_ENTROPY_HIGH_THRESHOLD above.
config SSM_TEMPORAL_DECAY_THRESHOLD
string "Temporal-locality threshold that enables L3 decay (SSM_TEMPORAL_DECAY_THRESHOLD)"
default "0.5"
help
Temporal locality strength above this value votes to enable
Loop #3 (decay). Previously unwired, same as
SSM_ENTROPY_HIGH_THRESHOLD above.
config SSM_TEMPORAL_DECAY_LOW_THRESHOLD
string "Lower temporal-locality threshold, combined with CV-high, for L6 (SSM_TEMPORAL_DECAY_LOW_THRESHOLD)"
default "0.3"
help
Lower temporal-locality bound that, combined with a high CV vote,
also enables Loop #6. Previously unwired, same as
SSM_ENTROPY_HIGH_THRESHOLD above.
config SSM_HYSTERESIS_TICKS
int "Consecutive ticks required before an L8 mode change commits (SSM_HYSTERESIS_TICKS)"
default 5
help
L8 Jacquard mode selection only commits after this many consecutive
heartbeat ticks vote for the same mode, preventing thrashing.
Previously unwired, same as SSM_ENTROPY_HIGH_THRESHOLD above.
endmenu