#188: the Jacquard selector's 64 cards, L7 permanently on, L2 a real gate
Captain Bob, 2026-11-12: "Wire L2, keep L7 on". The table held the 128 cards of the 7-bit L1-L7 space; nothing read L7, and the rolling window recorded whatever the card said, so the 128 were 32 behaviours. - compudynamics.c: cd_tuning_word() sizes the table to 64 (L1-L6). - ssm_jacquard.c: card_bits() makes a card's 7-bit mask, L7 set, where a card is read, seeded and started (C4: 17 -> card 8); ssm_l8_force_config() still takes the 7-bit index, its L7 bit implied. - physics_execution_hooks.c, kernel vm_core.c: the rolling window records only while L2 is on (or before there is a config). - ssm_jacquard.h says what is wired, bit by bit (it said L7 was); v3/CLAUDE.md and the L8 reference corrected in place; FABRIC-3 XLVIII.21. Tests first, seen to fail against HEAD (logs/20261112-210510/kernel-tests): test_ssm_jacquard 4 of 7, test_physics_l2 1 of 4; all pass now. v4 reads no rolling window: acceptance is unchanged; the protocol runs next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
@@ -49,7 +49,7 @@ CDTuning cd_tuning_word(void)
|
||||
t.volatility_high_threshold_q16 = 9830u; /* 0.15 * 65536 */
|
||||
t.locality_high_threshold_q16 = 32768u; /* 0.5 * 65536 */
|
||||
/* bandit */
|
||||
t.num_configs = 128u; /* 7-bit L1-L7 */
|
||||
t.num_configs = 64u; /* 6-bit L1-L6: L7 is permanently on, not chosen (#188) */
|
||||
t.num_regimes = 8u; /* 3-bit diversity/volatility/locality */
|
||||
t.score_max = 65535u;
|
||||
t.score_min = 0u;
|
||||
|
||||
@@ -94,8 +94,13 @@ void physics_pre_execute(VM* vm, DictEntry* word, DictEntry* prev)
|
||||
uint32_t word_id = word->word_id;
|
||||
if (word_id >= DICTIONARY_SIZE) return;
|
||||
|
||||
/* Loop #2: Rolling Window of Truth */
|
||||
rolling_window_record_execution(&vm->rolling_window, word_id);
|
||||
/* Loop #2: Rolling Window of Truth -- L8's live toggle, as L4 below (#188: it recorded
|
||||
* whatever the card said, so the selector's L2 bit did nothing). No config yet: recorded. */
|
||||
{
|
||||
const ssm_config_t *ssm_cfg = (const ssm_config_t*)vm->ssm_config;
|
||||
if (!ssm_cfg || ssm_cfg->L2_rolling_window)
|
||||
rolling_window_record_execution(&vm->rolling_window, word_id);
|
||||
}
|
||||
|
||||
/* Loop #4: Pipelining Transition Metrics. ENABLE_PIPELINING is the
|
||||
* compile-time ceiling; ssm_config's L4_pipelining is L8's live
|
||||
|
||||
+15
-8
@@ -228,6 +228,12 @@ const char* ssm_l8_mode_name(ssm_l8_mode_t mode)
|
||||
* @param table Pointer to the CDConfigTable to seed (already initialised
|
||||
* via cd_config_table_init())
|
||||
*/
|
||||
/* A card of the table is its index, 0..63: the six bits L1-L6, shifted up by one, with L7 -- the
|
||||
* adaptive heartrate, permanently on (docs/reference/L8_ADAPTIVE_CONFIG_TABLE.md; Captain Bob,
|
||||
* 2026-11-12: "Wire L2, keep L7 on") -- set below them. The table held 128, the 7-bit L1-L7 space,
|
||||
* though L7 is not the selector's to choose: the cards differing only in L7 were the same (#188). */
|
||||
static uint8_t card_bits(uint32_t card) { return (uint8_t)(((card & 0x3Fu) << 1) | SSM_CFG_L7); }
|
||||
|
||||
static void ssm_l8_seed_from_doe(CDConfigTable *table)
|
||||
{
|
||||
/* Top-5% config indices in 7-bit space */
|
||||
@@ -238,7 +244,7 @@ static void ssm_l8_seed_from_doe(CDConfigTable *table)
|
||||
uint32_t c, i;
|
||||
|
||||
for (c = 0u; c < tuning.num_configs; c++) {
|
||||
uint8_t bits = (uint8_t)c;
|
||||
uint8_t bits = card_bits(c);
|
||||
int has_l1 = (bits & SSM_CFG_L1) != 0;
|
||||
int has_l4 = (bits & SSM_CFG_L4) != 0;
|
||||
int is_top5 = 0;
|
||||
@@ -256,8 +262,8 @@ static void ssm_l8_seed_from_doe(CDConfigTable *table)
|
||||
initial_scores[c] = score;
|
||||
}
|
||||
|
||||
/* Start on C4-equivalent (config index 17: L3+L7 only) */
|
||||
cd_config_table_seed(table, &tuning, initial_scores, 17u);
|
||||
/* Start on C4-equivalent (7-bit 17, L3+L7 only: card 8) */
|
||||
cd_config_table_seed(table, &tuning, initial_scores, (uint8_t)(17u >> 1));
|
||||
}
|
||||
|
||||
/* ============================================================================
|
||||
@@ -288,7 +294,7 @@ static void ssm_l8_tick_score_and_select(CDConfigTable *table, ssm_config_t *con
|
||||
uint32_t current_window, uint32_t locality_q16)
|
||||
{
|
||||
CDTuning tuning = cd_tuning_word();
|
||||
uint8_t active_bits = table->entries[table->current_config].config_bits;
|
||||
uint8_t active_bits = card_bits(table->entries[table->current_config].config_bits);
|
||||
int use_joint_convergence = ((active_bits & SSM_CFG_L5) || (active_bits & SSM_CFG_L6)) ? 1 : 0;
|
||||
|
||||
/* --- ANOVA stability: this tick's own outcome, not an accumulated
|
||||
@@ -418,7 +424,7 @@ void ssm_l8_update_table(ssm_l8_state_t *state, const ssm_l8_metrics_t *metrics,
|
||||
|
||||
/* Mirror L2/L3/L5/L6 bits into the legacy mode field for diagnostics */
|
||||
{
|
||||
uint8_t bits = table->entries[table->current_config].config_bits;
|
||||
uint8_t bits = card_bits(table->entries[table->current_config].config_bits);
|
||||
state->current_mode = (ssm_l8_mode_t)(
|
||||
(((bits & SSM_CFG_L2) ? 1u : 0u) << 3) |
|
||||
(((bits & SSM_CFG_L3) ? 1u : 0u) << 2) |
|
||||
@@ -445,7 +451,7 @@ void ssm_apply_mode_from_table(const ssm_l8_state_t *state, ssm_config_t *config
|
||||
|
||||
if (!state || !state->table || !config) return;
|
||||
table = state->table;
|
||||
bits = table->entries[table->current_config].config_bits;
|
||||
bits = card_bits(table->entries[table->current_config].config_bits);
|
||||
|
||||
config->L1_heat_tracking = (bits & SSM_CFG_L1) ? 1 : 0;
|
||||
config->L2_rolling_window = (bits & SSM_CFG_L2) ? 1 : 0;
|
||||
@@ -472,11 +478,12 @@ void ssm_apply_mode_from_table(const ssm_l8_state_t *state, ssm_config_t *config
|
||||
*
|
||||
* @param state L8 state with an attached, initialised adaptive table
|
||||
* @param config Runtime configuration to update immediately
|
||||
* @param config_idx Desired config, masked to the 128-entry (7-bit) space
|
||||
* @param config_idx Desired config in the 7-bit L1-L7 space; its L7 bit is ignored -- L7 is on in
|
||||
* every card (#188) -- and it names card config_idx >> 1
|
||||
*/
|
||||
void ssm_l8_force_config(ssm_l8_state_t *state, ssm_config_t *config, uint8_t config_idx)
|
||||
{
|
||||
if (!state || !state->table || !config) return;
|
||||
cd_config_table_force(state->table, config_idx & 0x7Fu);
|
||||
cd_config_table_force(state->table, (uint8_t)((config_idx & 0x7Fu) >> 1)); /* its L7 bit is implied (#188) */
|
||||
ssm_apply_mode_from_table(state, config);
|
||||
}
|
||||
Reference in New Issue
Block a user