Преглед изворни кода

feat(contract): generate 6400 wire and snapshot contracts

root пре 3 месеци
родитељ
комит
4897407348

+ 9 - 0
contracts/6400-fixed-point.yaml

@@ -0,0 +1,9 @@
+schema: prod2u-6400-fixed-point-v1
+temperature: {unit: centi_degC, signed_bits: 16, scale: 100}
+error: {signed_bits: 16, unit: centi_degC}
+coefficient: {signed_bits: 16, integer_bits: 4, fractional_bits: 12, format: Q4.12}
+output: {signed_bits: 16, integer_bits: 8, fractional_bits: 8, format: Q8.8, min: 0, max: 25600}
+product: {signed_bits: 32, delta_to_output_shift: 4, rounding: half_away_from_zero}
+slew_limit_q8_8_per_epoch: 1280
+algorithm: incremental_pi
+kd: 0

+ 26 - 0
contracts/6400-snapshot.yaml

@@ -0,0 +1,26 @@
+schema: prod2u-6400-snapshot-v1
+byte_order: little
+max_payload_bytes: 200
+fields:
+  - {name: control_state, type: u8}
+  - {name: fault_flags, type: u16}
+  - {name: current_target, type: u8, unit: degC}
+  - {name: host_target_seen, type: u8}
+  - {name: bmc_epoch, type: u16}
+  - {name: ct_epoch, type: u16}
+  - {name: control_epoch, type: u16}
+  - {name: bmc_age, type: u16, unit: control_ticks}
+  - {name: ct_age, type: u16, unit: control_ticks}
+  - {name: bmc_raw, type: u16, count: 24}
+  - {name: bmc_valid_mask, type: bytes, count: 3}
+  - {name: ct_raw, type: u16, count: 27}
+  - {name: ct_valid_mask, type: bytes, count: 4}
+  - {name: ptc_requested, type: u8, count: 24}
+  - {name: ptc_applied, type: u8, count: 24}
+  - {name: front_requested, type: u8, count: 4}
+  - {name: front_applied, type: u8, count: 4}
+  - {name: rear_requested, type: u8, count: 4}
+  - {name: rear_applied, type: u8, count: 4}
+  - {name: safety_override_mask, type: bytes, count: 3}
+  - {name: lane_fault_mask, type: u8}
+  - {name: global_fault, type: u8}

+ 29 - 0
contracts/6400-wire.yaml

@@ -0,0 +1,29 @@
+schema: prod2u-6400-wire-v1
+clock_hz: 25000000
+device: EF2L45BG256B
+header: [0xA5, 0x5A]
+crc: {name: CRC-16/CCITT-FALSE, polynomial: 0x1021, initial: 0xFFFF, reflect_input: false, reflect_output: false, xor_output: 0, coverage: type_length_payload, wire_order: little}
+host_uart:
+  baud: 921600
+  format: 8N1
+  fixed_candidate_clks_per_bit: 27
+  rs232: {connector: CON78, tx_ball: M10, rx_ball: N11, status: confirmed}
+  ttl: {tx_ball: unknown, rx_ball: unknown, connector: unknown, level: LVCMOS33, status: unbound}
+bmc_uart:
+  baud: 115200
+  format: 8N1
+  clks_per_bit: 217
+  rs232: {connector: CON77, tx_ball: L10, rx_ball: M9, status: confirmed}
+  poll_ascii: "ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03\n"
+  response_data_bytes: 48
+commands:
+  SET_TARGET: {type: 0x01, payload_length: 1, response: SET_TARGET_ACK, valid: [0, 20-70]}
+  GET_SNAPSHOT: {type: 0x02, payload_length: 0, response: SNAPSHOT_DATA}
+  SET_STIMULUS: {type: 0x03, payload_length: 33, response: SET_STIMULUS_ACK, profiles: [identification, sim-debug]}
+responses:
+  SET_TARGET_ACK: {type: 0x81, payload_length: 0}
+  SNAPSHOT_DATA: {type: 0x82, payload_contract: 6400-snapshot.yaml}
+  SET_STIMULUS_ACK: {type: 0x83, payload_length: 0, profiles: [identification, sim-debug]}
+invalid_behavior: silent_drop
+outstanding_transactions: 1
+forbidden_fields: [protocol_version, project_id, profile_id, capability, sequence, transaction_id, timestamp, tlv, nack]

+ 32 - 0
contracts/channel-map.yaml

@@ -0,0 +1,32 @@
+schema: prod2u-6400-channel-map-v1
+product: 6400-front-rear-v1
+lanes:
+  - {air_lane: 0, cpu: 0, cpu_slots: [0, 5], thermal_zone: 0, cohort: primary}
+  - {air_lane: 1, cpu: 0, cpu_slots: [6, 11], thermal_zone: 1, cohort: primary}
+  - {air_lane: 2, cpu: 1, cpu_slots: [0, 5], thermal_zone: 1, cohort: primary}
+  - {air_lane: 3, cpu: 1, cpu_slots: [6, 11], thermal_zone: 2, cohort: holdout}
+channels:
+  - {logical_dimm: 0, cpu: 0, cpu_slot: 0, air_lane: 0, thermal_zone: 0, ptc_channel: 0, bmc_temperature_index: 0, ct7428_channel: unknown, front_fan_channel: 0, rear_fan_channel: 0, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM0, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 1, cpu: 0, cpu_slot: 1, air_lane: 0, thermal_zone: 0, ptc_channel: 1, bmc_temperature_index: 1, ct7428_channel: unknown, front_fan_channel: 0, rear_fan_channel: 0, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM1, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 2, cpu: 0, cpu_slot: 2, air_lane: 0, thermal_zone: 0, ptc_channel: 2, bmc_temperature_index: 2, ct7428_channel: unknown, front_fan_channel: 0, rear_fan_channel: 0, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM2, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 3, cpu: 0, cpu_slot: 3, air_lane: 0, thermal_zone: 0, ptc_channel: 3, bmc_temperature_index: 3, ct7428_channel: unknown, front_fan_channel: 0, rear_fan_channel: 0, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM3, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 4, cpu: 0, cpu_slot: 4, air_lane: 0, thermal_zone: 0, ptc_channel: 4, bmc_temperature_index: 4, ct7428_channel: unknown, front_fan_channel: 0, rear_fan_channel: 0, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM4, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 5, cpu: 0, cpu_slot: 5, air_lane: 0, thermal_zone: 0, ptc_channel: 5, bmc_temperature_index: 5, ct7428_channel: unknown, front_fan_channel: 0, rear_fan_channel: 0, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM5, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 6, cpu: 0, cpu_slot: 6, air_lane: 1, thermal_zone: 1, ptc_channel: 6, bmc_temperature_index: 6, ct7428_channel: unknown, front_fan_channel: 1, rear_fan_channel: 1, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM6, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 7, cpu: 0, cpu_slot: 7, air_lane: 1, thermal_zone: 1, ptc_channel: 7, bmc_temperature_index: 7, ct7428_channel: unknown, front_fan_channel: 1, rear_fan_channel: 1, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM7, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 8, cpu: 0, cpu_slot: 8, air_lane: 1, thermal_zone: 1, ptc_channel: 8, bmc_temperature_index: 8, ct7428_channel: unknown, front_fan_channel: 1, rear_fan_channel: 1, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM8, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 9, cpu: 0, cpu_slot: 9, air_lane: 1, thermal_zone: 1, ptc_channel: 9, bmc_temperature_index: 9, ct7428_channel: unknown, front_fan_channel: 1, rear_fan_channel: 1, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM9, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 10, cpu: 0, cpu_slot: 10, air_lane: 1, thermal_zone: 1, ptc_channel: 10, bmc_temperature_index: 10, ct7428_channel: unknown, front_fan_channel: 1, rear_fan_channel: 1, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM10, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 11, cpu: 0, cpu_slot: 11, air_lane: 1, thermal_zone: 1, ptc_channel: 11, bmc_temperature_index: 11, ct7428_channel: unknown, front_fan_channel: 1, rear_fan_channel: 1, primary_cohort: true, enabled: true, physical_label: CPU0_DIMM11, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 12, cpu: 1, cpu_slot: 0, air_lane: 2, thermal_zone: 1, ptc_channel: 12, bmc_temperature_index: 12, ct7428_channel: unknown, front_fan_channel: 2, rear_fan_channel: 2, primary_cohort: true, enabled: true, physical_label: CPU1_DIMM0, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 13, cpu: 1, cpu_slot: 1, air_lane: 2, thermal_zone: 1, ptc_channel: 13, bmc_temperature_index: 13, ct7428_channel: unknown, front_fan_channel: 2, rear_fan_channel: 2, primary_cohort: true, enabled: true, physical_label: CPU1_DIMM1, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 14, cpu: 1, cpu_slot: 2, air_lane: 2, thermal_zone: 1, ptc_channel: 14, bmc_temperature_index: 14, ct7428_channel: unknown, front_fan_channel: 2, rear_fan_channel: 2, primary_cohort: true, enabled: true, physical_label: CPU1_DIMM2, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 15, cpu: 1, cpu_slot: 3, air_lane: 2, thermal_zone: 1, ptc_channel: 15, bmc_temperature_index: 15, ct7428_channel: unknown, front_fan_channel: 2, rear_fan_channel: 2, primary_cohort: true, enabled: true, physical_label: CPU1_DIMM3, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 16, cpu: 1, cpu_slot: 4, air_lane: 2, thermal_zone: 1, ptc_channel: 16, bmc_temperature_index: 16, ct7428_channel: unknown, front_fan_channel: 2, rear_fan_channel: 2, primary_cohort: true, enabled: true, physical_label: CPU1_DIMM4, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 17, cpu: 1, cpu_slot: 5, air_lane: 2, thermal_zone: 1, ptc_channel: 17, bmc_temperature_index: 17, ct7428_channel: unknown, front_fan_channel: 2, rear_fan_channel: 2, primary_cohort: true, enabled: true, physical_label: CPU1_DIMM5, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 18, cpu: 1, cpu_slot: 6, air_lane: 3, thermal_zone: 2, ptc_channel: 18, bmc_temperature_index: 18, ct7428_channel: unknown, front_fan_channel: 3, rear_fan_channel: 3, primary_cohort: false, enabled: true, physical_label: CPU1_DIMM6, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 19, cpu: 1, cpu_slot: 7, air_lane: 3, thermal_zone: 2, ptc_channel: 19, bmc_temperature_index: 19, ct7428_channel: unknown, front_fan_channel: 3, rear_fan_channel: 3, primary_cohort: false, enabled: true, physical_label: CPU1_DIMM7, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 20, cpu: 1, cpu_slot: 8, air_lane: 3, thermal_zone: 2, ptc_channel: 20, bmc_temperature_index: 20, ct7428_channel: unknown, front_fan_channel: 3, rear_fan_channel: 3, primary_cohort: false, enabled: true, physical_label: CPU1_DIMM8, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 21, cpu: 1, cpu_slot: 9, air_lane: 3, thermal_zone: 2, ptc_channel: 21, bmc_temperature_index: 21, ct7428_channel: unknown, front_fan_channel: 3, rear_fan_channel: 3, primary_cohort: false, enabled: true, physical_label: CPU1_DIMM9, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 22, cpu: 1, cpu_slot: 10, air_lane: 3, thermal_zone: 2, ptc_channel: 22, bmc_temperature_index: 22, ct7428_channel: unknown, front_fan_channel: 3, rear_fan_channel: 3, primary_cohort: false, enabled: true, physical_label: CPU1_DIMM10, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}
+  - {logical_dimm: 23, cpu: 1, cpu_slot: 11, air_lane: 3, thermal_zone: 2, ptc_channel: 23, bmc_temperature_index: 23, ct7428_channel: unknown, front_fan_channel: 3, rear_fan_channel: 3, primary_cohort: false, enabled: true, physical_label: CPU1_DIMM11, evidence: {source: active-task-contract, location: topology, confidence: confirmed}}

+ 8 - 0
contracts/controller-coefficients.yaml

@@ -0,0 +1,8 @@
+schema: prod2u-6400-controller-coefficients-v1
+truth_label: SIMULATION_DEFAULT_NOT_HARDWARE_TUNED
+classes:
+  EDGE: {lanes: [0, 3], kp_q4_12: 32, ki_q4_12: 4}
+  CENTER: {lanes: [1, 2], kp_q4_12: 24, ki_q4_12: 3}
+limits_centi_degC: {soft: 7400, pretrip: 7600, hard: 7700, recovery_above_target: 200}
+targets_centi_degC: {default: 7000, preheat_offset: -500, ideal_band: 100, qualification_band: 700}
+recovery_epochs: 3

+ 6 - 0
contracts/fan-control-parameters.yaml

@@ -0,0 +1,6 @@
+schema: prod2u-6400-fan-control-v1
+truth_label: SIMULATION_DEFAULT_NOT_HARDWARE_TUNED
+duty: {reset: 10, stopped: 30, nominal: 30, warm: 50, protection: 80, hard: 100}
+temperature_centi_degC: {warm_delta_from_target: -300, protection: 7400, hard: 7700}
+invalid_lane_threshold: 2
+front_rear_independent: true

+ 32 - 0
docs/generated/6400-channel-map.md

@@ -0,0 +1,32 @@
+# Generated 6400 channel map
+
+Contract SHA-256: `06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1`.
+
+| DIMM | CPU slot | Lane | Zone | PTC | BMC | CT | Cohort |
+| ---: | --- | ---: | ---: | ---: | ---: | --- | --- |
+| 0 | CPU0/0 | 0 | 0 | 0 | 0 | unknown | primary |
+| 1 | CPU0/1 | 0 | 0 | 1 | 1 | unknown | primary |
+| 2 | CPU0/2 | 0 | 0 | 2 | 2 | unknown | primary |
+| 3 | CPU0/3 | 0 | 0 | 3 | 3 | unknown | primary |
+| 4 | CPU0/4 | 0 | 0 | 4 | 4 | unknown | primary |
+| 5 | CPU0/5 | 0 | 0 | 5 | 5 | unknown | primary |
+| 6 | CPU0/6 | 1 | 1 | 6 | 6 | unknown | primary |
+| 7 | CPU0/7 | 1 | 1 | 7 | 7 | unknown | primary |
+| 8 | CPU0/8 | 1 | 1 | 8 | 8 | unknown | primary |
+| 9 | CPU0/9 | 1 | 1 | 9 | 9 | unknown | primary |
+| 10 | CPU0/10 | 1 | 1 | 10 | 10 | unknown | primary |
+| 11 | CPU0/11 | 1 | 1 | 11 | 11 | unknown | primary |
+| 12 | CPU1/0 | 2 | 1 | 12 | 12 | unknown | primary |
+| 13 | CPU1/1 | 2 | 1 | 13 | 13 | unknown | primary |
+| 14 | CPU1/2 | 2 | 1 | 14 | 14 | unknown | primary |
+| 15 | CPU1/3 | 2 | 1 | 15 | 15 | unknown | primary |
+| 16 | CPU1/4 | 2 | 1 | 16 | 16 | unknown | primary |
+| 17 | CPU1/5 | 2 | 1 | 17 | 17 | unknown | primary |
+| 18 | CPU1/6 | 3 | 2 | 18 | 18 | unknown | holdout |
+| 19 | CPU1/7 | 3 | 2 | 19 | 19 | unknown | holdout |
+| 20 | CPU1/8 | 3 | 2 | 20 | 20 | unknown | holdout |
+| 21 | CPU1/9 | 3 | 2 | 21 | 21 | unknown | holdout |
+| 22 | CPU1/10 | 3 | 2 | 22 | 22 | unknown | holdout |
+| 23 | CPU1/11 | 3 | 2 | 23 | 23 | unknown | holdout |
+
+CT physical placement is explicitly unknown until board evidence closes it.

+ 529 - 0
generated/6400/channel-map.json

@@ -0,0 +1,529 @@
+{
+  "channels": [
+    {
+      "air_lane": 0,
+      "bmc_temperature_index": 0,
+      "cpu": 0,
+      "cpu_slot": 0,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 0,
+      "logical_dimm": 0,
+      "physical_label": "CPU0_DIMM0",
+      "primary_cohort": true,
+      "ptc_channel": 0,
+      "rear_fan_channel": 0,
+      "thermal_zone": 0
+    },
+    {
+      "air_lane": 0,
+      "bmc_temperature_index": 1,
+      "cpu": 0,
+      "cpu_slot": 1,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 0,
+      "logical_dimm": 1,
+      "physical_label": "CPU0_DIMM1",
+      "primary_cohort": true,
+      "ptc_channel": 1,
+      "rear_fan_channel": 0,
+      "thermal_zone": 0
+    },
+    {
+      "air_lane": 0,
+      "bmc_temperature_index": 2,
+      "cpu": 0,
+      "cpu_slot": 2,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 0,
+      "logical_dimm": 2,
+      "physical_label": "CPU0_DIMM2",
+      "primary_cohort": true,
+      "ptc_channel": 2,
+      "rear_fan_channel": 0,
+      "thermal_zone": 0
+    },
+    {
+      "air_lane": 0,
+      "bmc_temperature_index": 3,
+      "cpu": 0,
+      "cpu_slot": 3,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 0,
+      "logical_dimm": 3,
+      "physical_label": "CPU0_DIMM3",
+      "primary_cohort": true,
+      "ptc_channel": 3,
+      "rear_fan_channel": 0,
+      "thermal_zone": 0
+    },
+    {
+      "air_lane": 0,
+      "bmc_temperature_index": 4,
+      "cpu": 0,
+      "cpu_slot": 4,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 0,
+      "logical_dimm": 4,
+      "physical_label": "CPU0_DIMM4",
+      "primary_cohort": true,
+      "ptc_channel": 4,
+      "rear_fan_channel": 0,
+      "thermal_zone": 0
+    },
+    {
+      "air_lane": 0,
+      "bmc_temperature_index": 5,
+      "cpu": 0,
+      "cpu_slot": 5,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 0,
+      "logical_dimm": 5,
+      "physical_label": "CPU0_DIMM5",
+      "primary_cohort": true,
+      "ptc_channel": 5,
+      "rear_fan_channel": 0,
+      "thermal_zone": 0
+    },
+    {
+      "air_lane": 1,
+      "bmc_temperature_index": 6,
+      "cpu": 0,
+      "cpu_slot": 6,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 1,
+      "logical_dimm": 6,
+      "physical_label": "CPU0_DIMM6",
+      "primary_cohort": true,
+      "ptc_channel": 6,
+      "rear_fan_channel": 1,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 1,
+      "bmc_temperature_index": 7,
+      "cpu": 0,
+      "cpu_slot": 7,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 1,
+      "logical_dimm": 7,
+      "physical_label": "CPU0_DIMM7",
+      "primary_cohort": true,
+      "ptc_channel": 7,
+      "rear_fan_channel": 1,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 1,
+      "bmc_temperature_index": 8,
+      "cpu": 0,
+      "cpu_slot": 8,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 1,
+      "logical_dimm": 8,
+      "physical_label": "CPU0_DIMM8",
+      "primary_cohort": true,
+      "ptc_channel": 8,
+      "rear_fan_channel": 1,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 1,
+      "bmc_temperature_index": 9,
+      "cpu": 0,
+      "cpu_slot": 9,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 1,
+      "logical_dimm": 9,
+      "physical_label": "CPU0_DIMM9",
+      "primary_cohort": true,
+      "ptc_channel": 9,
+      "rear_fan_channel": 1,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 1,
+      "bmc_temperature_index": 10,
+      "cpu": 0,
+      "cpu_slot": 10,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 1,
+      "logical_dimm": 10,
+      "physical_label": "CPU0_DIMM10",
+      "primary_cohort": true,
+      "ptc_channel": 10,
+      "rear_fan_channel": 1,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 1,
+      "bmc_temperature_index": 11,
+      "cpu": 0,
+      "cpu_slot": 11,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 1,
+      "logical_dimm": 11,
+      "physical_label": "CPU0_DIMM11",
+      "primary_cohort": true,
+      "ptc_channel": 11,
+      "rear_fan_channel": 1,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 2,
+      "bmc_temperature_index": 12,
+      "cpu": 1,
+      "cpu_slot": 0,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 2,
+      "logical_dimm": 12,
+      "physical_label": "CPU1_DIMM0",
+      "primary_cohort": true,
+      "ptc_channel": 12,
+      "rear_fan_channel": 2,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 2,
+      "bmc_temperature_index": 13,
+      "cpu": 1,
+      "cpu_slot": 1,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 2,
+      "logical_dimm": 13,
+      "physical_label": "CPU1_DIMM1",
+      "primary_cohort": true,
+      "ptc_channel": 13,
+      "rear_fan_channel": 2,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 2,
+      "bmc_temperature_index": 14,
+      "cpu": 1,
+      "cpu_slot": 2,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 2,
+      "logical_dimm": 14,
+      "physical_label": "CPU1_DIMM2",
+      "primary_cohort": true,
+      "ptc_channel": 14,
+      "rear_fan_channel": 2,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 2,
+      "bmc_temperature_index": 15,
+      "cpu": 1,
+      "cpu_slot": 3,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 2,
+      "logical_dimm": 15,
+      "physical_label": "CPU1_DIMM3",
+      "primary_cohort": true,
+      "ptc_channel": 15,
+      "rear_fan_channel": 2,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 2,
+      "bmc_temperature_index": 16,
+      "cpu": 1,
+      "cpu_slot": 4,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 2,
+      "logical_dimm": 16,
+      "physical_label": "CPU1_DIMM4",
+      "primary_cohort": true,
+      "ptc_channel": 16,
+      "rear_fan_channel": 2,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 2,
+      "bmc_temperature_index": 17,
+      "cpu": 1,
+      "cpu_slot": 5,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 2,
+      "logical_dimm": 17,
+      "physical_label": "CPU1_DIMM5",
+      "primary_cohort": true,
+      "ptc_channel": 17,
+      "rear_fan_channel": 2,
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 3,
+      "bmc_temperature_index": 18,
+      "cpu": 1,
+      "cpu_slot": 6,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 3,
+      "logical_dimm": 18,
+      "physical_label": "CPU1_DIMM6",
+      "primary_cohort": false,
+      "ptc_channel": 18,
+      "rear_fan_channel": 3,
+      "thermal_zone": 2
+    },
+    {
+      "air_lane": 3,
+      "bmc_temperature_index": 19,
+      "cpu": 1,
+      "cpu_slot": 7,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 3,
+      "logical_dimm": 19,
+      "physical_label": "CPU1_DIMM7",
+      "primary_cohort": false,
+      "ptc_channel": 19,
+      "rear_fan_channel": 3,
+      "thermal_zone": 2
+    },
+    {
+      "air_lane": 3,
+      "bmc_temperature_index": 20,
+      "cpu": 1,
+      "cpu_slot": 8,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 3,
+      "logical_dimm": 20,
+      "physical_label": "CPU1_DIMM8",
+      "primary_cohort": false,
+      "ptc_channel": 20,
+      "rear_fan_channel": 3,
+      "thermal_zone": 2
+    },
+    {
+      "air_lane": 3,
+      "bmc_temperature_index": 21,
+      "cpu": 1,
+      "cpu_slot": 9,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 3,
+      "logical_dimm": 21,
+      "physical_label": "CPU1_DIMM9",
+      "primary_cohort": false,
+      "ptc_channel": 21,
+      "rear_fan_channel": 3,
+      "thermal_zone": 2
+    },
+    {
+      "air_lane": 3,
+      "bmc_temperature_index": 22,
+      "cpu": 1,
+      "cpu_slot": 10,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 3,
+      "logical_dimm": 22,
+      "physical_label": "CPU1_DIMM10",
+      "primary_cohort": false,
+      "ptc_channel": 22,
+      "rear_fan_channel": 3,
+      "thermal_zone": 2
+    },
+    {
+      "air_lane": 3,
+      "bmc_temperature_index": 23,
+      "cpu": 1,
+      "cpu_slot": 11,
+      "ct7428_channel": "unknown",
+      "enabled": true,
+      "evidence": {
+        "confidence": "confirmed",
+        "location": "topology",
+        "source": "active-task-contract"
+      },
+      "front_fan_channel": 3,
+      "logical_dimm": 23,
+      "physical_label": "CPU1_DIMM11",
+      "primary_cohort": false,
+      "ptc_channel": 23,
+      "rear_fan_channel": 3,
+      "thermal_zone": 2
+    }
+  ],
+  "contract_sha256": "06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1",
+  "lanes": [
+    {
+      "air_lane": 0,
+      "cohort": "primary",
+      "cpu": 0,
+      "cpu_slots": [
+        0,
+        5
+      ],
+      "thermal_zone": 0
+    },
+    {
+      "air_lane": 1,
+      "cohort": "primary",
+      "cpu": 0,
+      "cpu_slots": [
+        6,
+        11
+      ],
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 2,
+      "cohort": "primary",
+      "cpu": 1,
+      "cpu_slots": [
+        0,
+        5
+      ],
+      "thermal_zone": 1
+    },
+    {
+      "air_lane": 3,
+      "cohort": "holdout",
+      "cpu": 1,
+      "cpu_slots": [
+        6,
+        11
+      ],
+      "thermal_zone": 2
+    }
+  ],
+  "product": "6400-front-rear-v1",
+  "schema": "prod2u-6400-channel-map-v1"
+}

+ 1 - 0
generated/6400/contract-sha256.txt

@@ -0,0 +1 @@
+06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1

+ 36 - 0
generated/6400/controller-coefficients.json

@@ -0,0 +1,36 @@
+{
+  "classes": {
+    "CENTER": {
+      "ki_q4_12": 3,
+      "kp_q4_12": 24,
+      "lanes": [
+        1,
+        2
+      ]
+    },
+    "EDGE": {
+      "ki_q4_12": 4,
+      "kp_q4_12": 32,
+      "lanes": [
+        0,
+        3
+      ]
+    }
+  },
+  "contract_sha256": "06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1",
+  "limits_centi_degC": {
+    "hard": 7700,
+    "pretrip": 7600,
+    "recovery_above_target": 200,
+    "soft": 7400
+  },
+  "recovery_epochs": 3,
+  "schema": "prod2u-6400-controller-coefficients-v1",
+  "targets_centi_degC": {
+    "default": 7000,
+    "ideal_band": 100,
+    "preheat_offset": -500,
+    "qualification_band": 700
+  },
+  "truth_label": "SIMULATION_DEFAULT_NOT_HARDWARE_TUNED"
+}

+ 20 - 0
generated/6400/fan-control-parameters.json

@@ -0,0 +1,20 @@
+{
+  "contract_sha256": "06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1",
+  "duty": {
+    "hard": 100,
+    "nominal": 30,
+    "protection": 80,
+    "reset": 10,
+    "stopped": 30,
+    "warm": 50
+  },
+  "front_rear_independent": true,
+  "invalid_lane_threshold": 2,
+  "schema": "prod2u-6400-fan-control-v1",
+  "temperature_centi_degC": {
+    "hard": 7700,
+    "protection": 7400,
+    "warm_delta_from_target": -300
+  },
+  "truth_label": "SIMULATION_DEFAULT_NOT_HARDWARE_TUNED"
+}

+ 35 - 0
generated/6400/fixed-point.json

@@ -0,0 +1,35 @@
+{
+  "algorithm": "incremental_pi",
+  "coefficient": {
+    "format": "Q4.12",
+    "fractional_bits": 12,
+    "integer_bits": 4,
+    "signed_bits": 16
+  },
+  "contract_sha256": "06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1",
+  "error": {
+    "signed_bits": 16,
+    "unit": "centi_degC"
+  },
+  "kd": 0,
+  "output": {
+    "format": "Q8.8",
+    "fractional_bits": 8,
+    "integer_bits": 8,
+    "max": 25600,
+    "min": 0,
+    "signed_bits": 16
+  },
+  "product": {
+    "delta_to_output_shift": 4,
+    "rounding": "half_away_from_zero",
+    "signed_bits": 32
+  },
+  "schema": "prod2u-6400-fixed-point-v1",
+  "slew_limit_q8_8_per_epoch": 1280,
+  "temperature": {
+    "scale": 100,
+    "signed_bits": 16,
+    "unit": "centi_degC"
+  }
+}

+ 13 - 0
generated/6400/golden-vectors.json

@@ -0,0 +1,13 @@
+{
+  "contract_sha256": "06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1",
+  "frames": {
+    "get_snapshot": "A55A02006D7B",
+    "set_target_20": "A55A010114289A",
+    "set_target_70": "A55A0101469FE0",
+    "set_target_ack": "A55A8100A635",
+    "set_target_stop": "A55A0101009DC8",
+    "stimulus_ack": "A55A8300C453",
+    "stimulus_all_zero_one_second": "A55A03210100000000000000000000000000000000000000000000000000000000000000009782"
+  },
+  "schema": "prod2u-6400-golden-vectors-v1"
+}

+ 893 - 0
generated/6400/host-contract.json

@@ -0,0 +1,893 @@
+{
+  "channel_map": {
+    "channels": [
+      {
+        "air_lane": 0,
+        "bmc_temperature_index": 0,
+        "cpu": 0,
+        "cpu_slot": 0,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 0,
+        "logical_dimm": 0,
+        "physical_label": "CPU0_DIMM0",
+        "primary_cohort": true,
+        "ptc_channel": 0,
+        "rear_fan_channel": 0,
+        "thermal_zone": 0
+      },
+      {
+        "air_lane": 0,
+        "bmc_temperature_index": 1,
+        "cpu": 0,
+        "cpu_slot": 1,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 0,
+        "logical_dimm": 1,
+        "physical_label": "CPU0_DIMM1",
+        "primary_cohort": true,
+        "ptc_channel": 1,
+        "rear_fan_channel": 0,
+        "thermal_zone": 0
+      },
+      {
+        "air_lane": 0,
+        "bmc_temperature_index": 2,
+        "cpu": 0,
+        "cpu_slot": 2,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 0,
+        "logical_dimm": 2,
+        "physical_label": "CPU0_DIMM2",
+        "primary_cohort": true,
+        "ptc_channel": 2,
+        "rear_fan_channel": 0,
+        "thermal_zone": 0
+      },
+      {
+        "air_lane": 0,
+        "bmc_temperature_index": 3,
+        "cpu": 0,
+        "cpu_slot": 3,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 0,
+        "logical_dimm": 3,
+        "physical_label": "CPU0_DIMM3",
+        "primary_cohort": true,
+        "ptc_channel": 3,
+        "rear_fan_channel": 0,
+        "thermal_zone": 0
+      },
+      {
+        "air_lane": 0,
+        "bmc_temperature_index": 4,
+        "cpu": 0,
+        "cpu_slot": 4,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 0,
+        "logical_dimm": 4,
+        "physical_label": "CPU0_DIMM4",
+        "primary_cohort": true,
+        "ptc_channel": 4,
+        "rear_fan_channel": 0,
+        "thermal_zone": 0
+      },
+      {
+        "air_lane": 0,
+        "bmc_temperature_index": 5,
+        "cpu": 0,
+        "cpu_slot": 5,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 0,
+        "logical_dimm": 5,
+        "physical_label": "CPU0_DIMM5",
+        "primary_cohort": true,
+        "ptc_channel": 5,
+        "rear_fan_channel": 0,
+        "thermal_zone": 0
+      },
+      {
+        "air_lane": 1,
+        "bmc_temperature_index": 6,
+        "cpu": 0,
+        "cpu_slot": 6,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 1,
+        "logical_dimm": 6,
+        "physical_label": "CPU0_DIMM6",
+        "primary_cohort": true,
+        "ptc_channel": 6,
+        "rear_fan_channel": 1,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 1,
+        "bmc_temperature_index": 7,
+        "cpu": 0,
+        "cpu_slot": 7,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 1,
+        "logical_dimm": 7,
+        "physical_label": "CPU0_DIMM7",
+        "primary_cohort": true,
+        "ptc_channel": 7,
+        "rear_fan_channel": 1,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 1,
+        "bmc_temperature_index": 8,
+        "cpu": 0,
+        "cpu_slot": 8,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 1,
+        "logical_dimm": 8,
+        "physical_label": "CPU0_DIMM8",
+        "primary_cohort": true,
+        "ptc_channel": 8,
+        "rear_fan_channel": 1,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 1,
+        "bmc_temperature_index": 9,
+        "cpu": 0,
+        "cpu_slot": 9,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 1,
+        "logical_dimm": 9,
+        "physical_label": "CPU0_DIMM9",
+        "primary_cohort": true,
+        "ptc_channel": 9,
+        "rear_fan_channel": 1,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 1,
+        "bmc_temperature_index": 10,
+        "cpu": 0,
+        "cpu_slot": 10,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 1,
+        "logical_dimm": 10,
+        "physical_label": "CPU0_DIMM10",
+        "primary_cohort": true,
+        "ptc_channel": 10,
+        "rear_fan_channel": 1,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 1,
+        "bmc_temperature_index": 11,
+        "cpu": 0,
+        "cpu_slot": 11,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 1,
+        "logical_dimm": 11,
+        "physical_label": "CPU0_DIMM11",
+        "primary_cohort": true,
+        "ptc_channel": 11,
+        "rear_fan_channel": 1,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 2,
+        "bmc_temperature_index": 12,
+        "cpu": 1,
+        "cpu_slot": 0,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 2,
+        "logical_dimm": 12,
+        "physical_label": "CPU1_DIMM0",
+        "primary_cohort": true,
+        "ptc_channel": 12,
+        "rear_fan_channel": 2,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 2,
+        "bmc_temperature_index": 13,
+        "cpu": 1,
+        "cpu_slot": 1,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 2,
+        "logical_dimm": 13,
+        "physical_label": "CPU1_DIMM1",
+        "primary_cohort": true,
+        "ptc_channel": 13,
+        "rear_fan_channel": 2,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 2,
+        "bmc_temperature_index": 14,
+        "cpu": 1,
+        "cpu_slot": 2,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 2,
+        "logical_dimm": 14,
+        "physical_label": "CPU1_DIMM2",
+        "primary_cohort": true,
+        "ptc_channel": 14,
+        "rear_fan_channel": 2,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 2,
+        "bmc_temperature_index": 15,
+        "cpu": 1,
+        "cpu_slot": 3,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 2,
+        "logical_dimm": 15,
+        "physical_label": "CPU1_DIMM3",
+        "primary_cohort": true,
+        "ptc_channel": 15,
+        "rear_fan_channel": 2,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 2,
+        "bmc_temperature_index": 16,
+        "cpu": 1,
+        "cpu_slot": 4,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 2,
+        "logical_dimm": 16,
+        "physical_label": "CPU1_DIMM4",
+        "primary_cohort": true,
+        "ptc_channel": 16,
+        "rear_fan_channel": 2,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 2,
+        "bmc_temperature_index": 17,
+        "cpu": 1,
+        "cpu_slot": 5,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 2,
+        "logical_dimm": 17,
+        "physical_label": "CPU1_DIMM5",
+        "primary_cohort": true,
+        "ptc_channel": 17,
+        "rear_fan_channel": 2,
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 3,
+        "bmc_temperature_index": 18,
+        "cpu": 1,
+        "cpu_slot": 6,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 3,
+        "logical_dimm": 18,
+        "physical_label": "CPU1_DIMM6",
+        "primary_cohort": false,
+        "ptc_channel": 18,
+        "rear_fan_channel": 3,
+        "thermal_zone": 2
+      },
+      {
+        "air_lane": 3,
+        "bmc_temperature_index": 19,
+        "cpu": 1,
+        "cpu_slot": 7,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 3,
+        "logical_dimm": 19,
+        "physical_label": "CPU1_DIMM7",
+        "primary_cohort": false,
+        "ptc_channel": 19,
+        "rear_fan_channel": 3,
+        "thermal_zone": 2
+      },
+      {
+        "air_lane": 3,
+        "bmc_temperature_index": 20,
+        "cpu": 1,
+        "cpu_slot": 8,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 3,
+        "logical_dimm": 20,
+        "physical_label": "CPU1_DIMM8",
+        "primary_cohort": false,
+        "ptc_channel": 20,
+        "rear_fan_channel": 3,
+        "thermal_zone": 2
+      },
+      {
+        "air_lane": 3,
+        "bmc_temperature_index": 21,
+        "cpu": 1,
+        "cpu_slot": 9,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 3,
+        "logical_dimm": 21,
+        "physical_label": "CPU1_DIMM9",
+        "primary_cohort": false,
+        "ptc_channel": 21,
+        "rear_fan_channel": 3,
+        "thermal_zone": 2
+      },
+      {
+        "air_lane": 3,
+        "bmc_temperature_index": 22,
+        "cpu": 1,
+        "cpu_slot": 10,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 3,
+        "logical_dimm": 22,
+        "physical_label": "CPU1_DIMM10",
+        "primary_cohort": false,
+        "ptc_channel": 22,
+        "rear_fan_channel": 3,
+        "thermal_zone": 2
+      },
+      {
+        "air_lane": 3,
+        "bmc_temperature_index": 23,
+        "cpu": 1,
+        "cpu_slot": 11,
+        "ct7428_channel": "unknown",
+        "enabled": true,
+        "evidence": {
+          "confidence": "confirmed",
+          "location": "topology",
+          "source": "active-task-contract"
+        },
+        "front_fan_channel": 3,
+        "logical_dimm": 23,
+        "physical_label": "CPU1_DIMM11",
+        "primary_cohort": false,
+        "ptc_channel": 23,
+        "rear_fan_channel": 3,
+        "thermal_zone": 2
+      }
+    ],
+    "lanes": [
+      {
+        "air_lane": 0,
+        "cohort": "primary",
+        "cpu": 0,
+        "cpu_slots": [
+          0,
+          5
+        ],
+        "thermal_zone": 0
+      },
+      {
+        "air_lane": 1,
+        "cohort": "primary",
+        "cpu": 0,
+        "cpu_slots": [
+          6,
+          11
+        ],
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 2,
+        "cohort": "primary",
+        "cpu": 1,
+        "cpu_slots": [
+          0,
+          5
+        ],
+        "thermal_zone": 1
+      },
+      {
+        "air_lane": 3,
+        "cohort": "holdout",
+        "cpu": 1,
+        "cpu_slots": [
+          6,
+          11
+        ],
+        "thermal_zone": 2
+      }
+    ],
+    "product": "6400-front-rear-v1",
+    "schema": "prod2u-6400-channel-map-v1"
+  },
+  "contract_sha256": "06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1",
+  "controller_coefficients": {
+    "classes": {
+      "CENTER": {
+        "ki_q4_12": 3,
+        "kp_q4_12": 24,
+        "lanes": [
+          1,
+          2
+        ]
+      },
+      "EDGE": {
+        "ki_q4_12": 4,
+        "kp_q4_12": 32,
+        "lanes": [
+          0,
+          3
+        ]
+      }
+    },
+    "limits_centi_degC": {
+      "hard": 7700,
+      "pretrip": 7600,
+      "recovery_above_target": 200,
+      "soft": 7400
+    },
+    "recovery_epochs": 3,
+    "schema": "prod2u-6400-controller-coefficients-v1",
+    "targets_centi_degC": {
+      "default": 7000,
+      "ideal_band": 100,
+      "preheat_offset": -500,
+      "qualification_band": 700
+    },
+    "truth_label": "SIMULATION_DEFAULT_NOT_HARDWARE_TUNED"
+  },
+  "fan_control": {
+    "duty": {
+      "hard": 100,
+      "nominal": 30,
+      "protection": 80,
+      "reset": 10,
+      "stopped": 30,
+      "warm": 50
+    },
+    "front_rear_independent": true,
+    "invalid_lane_threshold": 2,
+    "schema": "prod2u-6400-fan-control-v1",
+    "temperature_centi_degC": {
+      "hard": 7700,
+      "protection": 7400,
+      "warm_delta_from_target": -300
+    },
+    "truth_label": "SIMULATION_DEFAULT_NOT_HARDWARE_TUNED"
+  },
+  "fixed_point": {
+    "algorithm": "incremental_pi",
+    "coefficient": {
+      "format": "Q4.12",
+      "fractional_bits": 12,
+      "integer_bits": 4,
+      "signed_bits": 16
+    },
+    "error": {
+      "signed_bits": 16,
+      "unit": "centi_degC"
+    },
+    "kd": 0,
+    "output": {
+      "format": "Q8.8",
+      "fractional_bits": 8,
+      "integer_bits": 8,
+      "max": 25600,
+      "min": 0,
+      "signed_bits": 16
+    },
+    "product": {
+      "delta_to_output_shift": 4,
+      "rounding": "half_away_from_zero",
+      "signed_bits": 32
+    },
+    "schema": "prod2u-6400-fixed-point-v1",
+    "slew_limit_q8_8_per_epoch": 1280,
+    "temperature": {
+      "scale": 100,
+      "signed_bits": 16,
+      "unit": "centi_degC"
+    }
+  },
+  "golden_vectors": {
+    "contract_sha256": "06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1",
+    "frames": {
+      "get_snapshot": "A55A02006D7B",
+      "set_target_20": "A55A010114289A",
+      "set_target_70": "A55A0101469FE0",
+      "set_target_ack": "A55A8100A635",
+      "set_target_stop": "A55A0101009DC8",
+      "stimulus_ack": "A55A8300C453",
+      "stimulus_all_zero_one_second": "A55A03210100000000000000000000000000000000000000000000000000000000000000009782"
+    },
+    "schema": "prod2u-6400-golden-vectors-v1"
+  },
+  "schema": "prod2u-6400-host-contract-v1",
+  "snapshot": {
+    "byte_order": "little",
+    "contract_sha256": "06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1",
+    "fields": [
+      {
+        "name": "control_state",
+        "offset": 0,
+        "size": 1,
+        "type": "u8"
+      },
+      {
+        "name": "fault_flags",
+        "offset": 1,
+        "size": 2,
+        "type": "u16"
+      },
+      {
+        "name": "current_target",
+        "offset": 3,
+        "size": 1,
+        "type": "u8",
+        "unit": "degC"
+      },
+      {
+        "name": "host_target_seen",
+        "offset": 4,
+        "size": 1,
+        "type": "u8"
+      },
+      {
+        "name": "bmc_epoch",
+        "offset": 5,
+        "size": 2,
+        "type": "u16"
+      },
+      {
+        "name": "ct_epoch",
+        "offset": 7,
+        "size": 2,
+        "type": "u16"
+      },
+      {
+        "name": "control_epoch",
+        "offset": 9,
+        "size": 2,
+        "type": "u16"
+      },
+      {
+        "name": "bmc_age",
+        "offset": 11,
+        "size": 2,
+        "type": "u16",
+        "unit": "control_ticks"
+      },
+      {
+        "name": "ct_age",
+        "offset": 13,
+        "size": 2,
+        "type": "u16",
+        "unit": "control_ticks"
+      },
+      {
+        "count": 24,
+        "name": "bmc_raw",
+        "offset": 15,
+        "size": 48,
+        "type": "u16"
+      },
+      {
+        "count": 3,
+        "name": "bmc_valid_mask",
+        "offset": 63,
+        "size": 3,
+        "type": "bytes"
+      },
+      {
+        "count": 27,
+        "name": "ct_raw",
+        "offset": 66,
+        "size": 54,
+        "type": "u16"
+      },
+      {
+        "count": 4,
+        "name": "ct_valid_mask",
+        "offset": 120,
+        "size": 4,
+        "type": "bytes"
+      },
+      {
+        "count": 24,
+        "name": "ptc_requested",
+        "offset": 124,
+        "size": 24,
+        "type": "u8"
+      },
+      {
+        "count": 24,
+        "name": "ptc_applied",
+        "offset": 148,
+        "size": 24,
+        "type": "u8"
+      },
+      {
+        "count": 4,
+        "name": "front_requested",
+        "offset": 172,
+        "size": 4,
+        "type": "u8"
+      },
+      {
+        "count": 4,
+        "name": "front_applied",
+        "offset": 176,
+        "size": 4,
+        "type": "u8"
+      },
+      {
+        "count": 4,
+        "name": "rear_requested",
+        "offset": 180,
+        "size": 4,
+        "type": "u8"
+      },
+      {
+        "count": 4,
+        "name": "rear_applied",
+        "offset": 184,
+        "size": 4,
+        "type": "u8"
+      },
+      {
+        "count": 3,
+        "name": "safety_override_mask",
+        "offset": 188,
+        "size": 3,
+        "type": "bytes"
+      },
+      {
+        "name": "lane_fault_mask",
+        "offset": 191,
+        "size": 1,
+        "type": "u8"
+      },
+      {
+        "name": "global_fault",
+        "offset": 192,
+        "size": 1,
+        "type": "u8"
+      }
+    ],
+    "payload_length": 193,
+    "schema": "prod2u-6400-snapshot-v1"
+  },
+  "wire": {
+    "bmc_uart": {
+      "baud": 115200,
+      "clks_per_bit": 217,
+      "format": "8N1",
+      "poll_ascii": "ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03\n",
+      "response_data_bytes": 48,
+      "rs232": {
+        "connector": "CON77",
+        "rx_ball": "M9",
+        "status": "confirmed",
+        "tx_ball": "L10"
+      }
+    },
+    "clock_hz": 25000000,
+    "commands": {
+      "GET_SNAPSHOT": {
+        "payload_length": 0,
+        "response": "SNAPSHOT_DATA",
+        "type": 2
+      },
+      "SET_STIMULUS": {
+        "payload_length": 33,
+        "profiles": [
+          "identification",
+          "sim-debug"
+        ],
+        "response": "SET_STIMULUS_ACK",
+        "type": 3
+      },
+      "SET_TARGET": {
+        "payload_length": 1,
+        "response": "SET_TARGET_ACK",
+        "type": 1,
+        "valid": [
+          0,
+          "20-70"
+        ]
+      }
+    },
+    "crc": {
+      "coverage": "type_length_payload",
+      "initial": 65535,
+      "name": "CRC-16/CCITT-FALSE",
+      "polynomial": 4129,
+      "reflect_input": false,
+      "reflect_output": false,
+      "wire_order": "little",
+      "xor_output": 0
+    },
+    "device": "EF2L45BG256B",
+    "forbidden_fields": [
+      "protocol_version",
+      "project_id",
+      "profile_id",
+      "capability",
+      "sequence",
+      "transaction_id",
+      "timestamp",
+      "tlv",
+      "nack"
+    ],
+    "header": [
+      165,
+      90
+    ],
+    "host_uart": {
+      "baud": 921600,
+      "fixed_candidate_clks_per_bit": 27,
+      "format": "8N1",
+      "rs232": {
+        "connector": "CON78",
+        "rx_ball": "N11",
+        "status": "confirmed",
+        "tx_ball": "M10"
+      },
+      "ttl": {
+        "connector": "unknown",
+        "level": "LVCMOS33",
+        "rx_ball": "unknown",
+        "status": "unbound",
+        "tx_ball": "unknown"
+      }
+    },
+    "invalid_behavior": "silent_drop",
+    "outstanding_transactions": 1,
+    "responses": {
+      "SET_STIMULUS_ACK": {
+        "payload_length": 0,
+        "profiles": [
+          "identification",
+          "sim-debug"
+        ],
+        "type": 131
+      },
+      "SET_TARGET_ACK": {
+        "payload_length": 0,
+        "type": 129
+      },
+      "SNAPSHOT_DATA": {
+        "payload_contract": "6400-snapshot.yaml",
+        "type": 130
+      }
+    },
+    "schema": "prod2u-6400-wire-v1"
+  }
+}

+ 59 - 0
generated/6400/prod2u_6400_v1_params.vh

@@ -0,0 +1,59 @@
+`ifndef PROD2U_6400_V1_PARAMS_VH
+`define PROD2U_6400_V1_PARAMS_VH
+// Generated contract SHA-256: 06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1
+`define FB_CLOCK_HZ 25000000
+`define FB_PTC_COUNT 24
+`define FB_FRONT_FAN_COUNT 4
+`define FB_REAR_FAN_COUNT 4
+`define FB_OUTPUT_COUNT 32
+`define FB_BMC_COUNT 24
+`define FB_CT_COUNT 27
+`define FB_PRIMARY_COUNT 18
+`define FB_HOLDOUT_COUNT 6
+`define FB_HOST_BAUD 921600
+`define FB_BMC_BAUD 115200
+`define FB_HOST_FIXED_CLKS_PER_BIT 27
+`define FB_BMC_CLKS_PER_BIT 217
+`define FB_PWM_PHASES 100
+`define FB_PWM_PHASE_CLKS 500
+`define FB_PWM_PERIOD_CLKS 50000
+`define FB_CMD_SET_TARGET 8'h01
+`define FB_CMD_GET_SNAPSHOT 8'h02
+`define FB_CMD_SET_STIMULUS 8'h03
+`define FB_RSP_SET_TARGET_ACK 8'h81
+`define FB_RSP_SNAPSHOT 8'h82
+`define FB_RSP_STIMULUS_ACK 8'h83
+`define FB_SNAPSHOT_LENGTH 193
+`define FB_TEMP_SOFT 7400
+`define FB_TEMP_PRETRIP 7600
+`define FB_TEMP_HARD 7700
+`define FB_TEMP_DEFAULT_TARGET 7000
+`define FB_EDGE_KP_Q4_12 32
+`define FB_EDGE_KI_Q4_12 4
+`define FB_CENTER_KP_Q4_12 24
+`define FB_CENTER_KI_Q4_12 3
+`define FB_FAN_RESET 10
+`define FB_FAN_HARD 100
+`define FB_SNAPSHOT_CONTROL_STATE_OFFSET 0
+`define FB_SNAPSHOT_FAULT_FLAGS_OFFSET 1
+`define FB_SNAPSHOT_CURRENT_TARGET_OFFSET 3
+`define FB_SNAPSHOT_HOST_TARGET_SEEN_OFFSET 4
+`define FB_SNAPSHOT_BMC_EPOCH_OFFSET 5
+`define FB_SNAPSHOT_CT_EPOCH_OFFSET 7
+`define FB_SNAPSHOT_CONTROL_EPOCH_OFFSET 9
+`define FB_SNAPSHOT_BMC_AGE_OFFSET 11
+`define FB_SNAPSHOT_CT_AGE_OFFSET 13
+`define FB_SNAPSHOT_BMC_RAW_OFFSET 15
+`define FB_SNAPSHOT_BMC_VALID_MASK_OFFSET 63
+`define FB_SNAPSHOT_CT_RAW_OFFSET 66
+`define FB_SNAPSHOT_CT_VALID_MASK_OFFSET 120
+`define FB_SNAPSHOT_PTC_REQUESTED_OFFSET 124
+`define FB_SNAPSHOT_PTC_APPLIED_OFFSET 148
+`define FB_SNAPSHOT_FRONT_REQUESTED_OFFSET 172
+`define FB_SNAPSHOT_FRONT_APPLIED_OFFSET 176
+`define FB_SNAPSHOT_REAR_REQUESTED_OFFSET 180
+`define FB_SNAPSHOT_REAR_APPLIED_OFFSET 184
+`define FB_SNAPSHOT_SAFETY_OVERRIDE_MASK_OFFSET 188
+`define FB_SNAPSHOT_LANE_FAULT_MASK_OFFSET 191
+`define FB_SNAPSHOT_GLOBAL_FAULT_OFFSET 192
+`endif

+ 154 - 0
generated/6400/snapshot-layout.json

@@ -0,0 +1,154 @@
+{
+  "byte_order": "little",
+  "contract_sha256": "06c18dee5c27c4830398c8bc348d7fe868cde72aebe4c3be68b562f00e9b0fc1",
+  "fields": [
+    {
+      "name": "control_state",
+      "offset": 0,
+      "size": 1,
+      "type": "u8"
+    },
+    {
+      "name": "fault_flags",
+      "offset": 1,
+      "size": 2,
+      "type": "u16"
+    },
+    {
+      "name": "current_target",
+      "offset": 3,
+      "size": 1,
+      "type": "u8",
+      "unit": "degC"
+    },
+    {
+      "name": "host_target_seen",
+      "offset": 4,
+      "size": 1,
+      "type": "u8"
+    },
+    {
+      "name": "bmc_epoch",
+      "offset": 5,
+      "size": 2,
+      "type": "u16"
+    },
+    {
+      "name": "ct_epoch",
+      "offset": 7,
+      "size": 2,
+      "type": "u16"
+    },
+    {
+      "name": "control_epoch",
+      "offset": 9,
+      "size": 2,
+      "type": "u16"
+    },
+    {
+      "name": "bmc_age",
+      "offset": 11,
+      "size": 2,
+      "type": "u16",
+      "unit": "control_ticks"
+    },
+    {
+      "name": "ct_age",
+      "offset": 13,
+      "size": 2,
+      "type": "u16",
+      "unit": "control_ticks"
+    },
+    {
+      "count": 24,
+      "name": "bmc_raw",
+      "offset": 15,
+      "size": 48,
+      "type": "u16"
+    },
+    {
+      "count": 3,
+      "name": "bmc_valid_mask",
+      "offset": 63,
+      "size": 3,
+      "type": "bytes"
+    },
+    {
+      "count": 27,
+      "name": "ct_raw",
+      "offset": 66,
+      "size": 54,
+      "type": "u16"
+    },
+    {
+      "count": 4,
+      "name": "ct_valid_mask",
+      "offset": 120,
+      "size": 4,
+      "type": "bytes"
+    },
+    {
+      "count": 24,
+      "name": "ptc_requested",
+      "offset": 124,
+      "size": 24,
+      "type": "u8"
+    },
+    {
+      "count": 24,
+      "name": "ptc_applied",
+      "offset": 148,
+      "size": 24,
+      "type": "u8"
+    },
+    {
+      "count": 4,
+      "name": "front_requested",
+      "offset": 172,
+      "size": 4,
+      "type": "u8"
+    },
+    {
+      "count": 4,
+      "name": "front_applied",
+      "offset": 176,
+      "size": 4,
+      "type": "u8"
+    },
+    {
+      "count": 4,
+      "name": "rear_requested",
+      "offset": 180,
+      "size": 4,
+      "type": "u8"
+    },
+    {
+      "count": 4,
+      "name": "rear_applied",
+      "offset": 184,
+      "size": 4,
+      "type": "u8"
+    },
+    {
+      "count": 3,
+      "name": "safety_override_mask",
+      "offset": 188,
+      "size": 3,
+      "type": "bytes"
+    },
+    {
+      "name": "lane_fault_mask",
+      "offset": 191,
+      "size": 1,
+      "type": "u8"
+    },
+    {
+      "name": "global_fault",
+      "offset": 192,
+      "size": 1,
+      "type": "u8"
+    }
+  ],
+  "payload_length": 193,
+  "schema": "prod2u-6400-snapshot-v1"
+}

+ 49 - 0
tests/unit/test_6400_v1_contract.py

@@ -0,0 +1,49 @@
+from pathlib import Path
+import subprocess
+
+import yaml
+
+from tools.generate_6400_v1 import generate, layout, load_yaml, validate_channels
+
+
+ROOT = Path(__file__).resolve().parents[2]
+
+
+def test_channel_map_is_exact_and_holdout_is_not_disabled() -> None:
+    mapping = load_yaml("channel-map.yaml")
+    validate_channels(mapping)
+    assert sum(bool(row["primary_cohort"]) for row in mapping["channels"]) == 18
+    assert sum(not bool(row["primary_cohort"]) for row in mapping["channels"]) == 6
+    assert all(bool(row["enabled"]) for row in mapping["channels"])
+
+
+def test_snapshot_layout_is_fixed_193_bytes() -> None:
+    rows, size = layout(load_yaml("6400-snapshot.yaml"))
+    assert size == 193
+    assert rows[0]["offset"] == 0
+    assert rows[-1]["name"] == "global_fault"
+    assert rows[-1]["offset"] == 192
+
+
+def test_wire_has_no_forbidden_online_identity() -> None:
+    wire = load_yaml("6400-wire.yaml")
+    text = yaml.safe_dump(wire).lower()
+    for forbidden in ("protocol_version", "project_id", "sequence", "nack"):
+        assert forbidden in wire["forbidden_fields"]
+    assert "host_watchdog" not in text
+    assert wire["host_uart"]["baud"] == 921600
+    assert wire["bmc_uart"]["baud"] == 115200
+
+
+def test_generation_matches_tracked_outputs() -> None:
+    subprocess.run(
+        ["python3", str(ROOT / "tools/generate_6400_v1.py"), "--check"],
+        cwd=ROOT,
+        check=True,
+    )
+
+
+def test_generator_output_set_is_deterministic(tmp_path: Path) -> None:
+    first = generate(tmp_path / "a")
+    second = generate(tmp_path / "a")
+    assert first == second

+ 284 - 0
tools/generate_6400_v1.py

@@ -0,0 +1,284 @@
+#!/usr/bin/env python3
+"""Generate every 6400 wire/layout mapping from the YAML contract set."""
+
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+from pathlib import Path
+import sys
+from typing import Any
+
+import yaml
+
+
+ROOT = Path(__file__).resolve().parents[1]
+CONTRACT_DIR = ROOT / "contracts"
+DEFAULT_OUTPUT = ROOT / "generated" / "6400"
+INPUTS = (
+    "channel-map.yaml",
+    "6400-wire.yaml",
+    "6400-snapshot.yaml",
+    "6400-fixed-point.yaml",
+    "controller-coefficients.yaml",
+    "fan-control-parameters.yaml",
+)
+TYPE_BYTES = {"u8": 1, "u16": 2, "u32": 4, "bytes": 1}
+
+
+def load_yaml(name: str) -> dict[str, Any]:
+    value = yaml.safe_load((CONTRACT_DIR / name).read_text(encoding="utf-8"))
+    if not isinstance(value, dict):
+        raise ValueError(f"{name}: root must be mapping")
+    return value
+
+
+def source_hash() -> str:
+    digest = hashlib.sha256()
+    for name in INPUTS:
+        digest.update(name.encode())
+        digest.update(b"\0")
+        digest.update((CONTRACT_DIR / name).read_bytes())
+        digest.update(b"\0")
+    return digest.hexdigest()
+
+
+def validate_channels(mapping: dict[str, Any]) -> None:
+    rows = mapping.get("channels")
+    if not isinstance(rows, list) or len(rows) != 24:
+        raise ValueError("channel map must contain 24 rows")
+    required = {
+        "logical_dimm", "cpu", "cpu_slot", "air_lane", "thermal_zone",
+        "ptc_channel", "bmc_temperature_index", "ct7428_channel",
+        "front_fan_channel", "rear_fan_channel", "primary_cohort", "enabled",
+        "physical_label", "evidence",
+    }
+    for row in rows:
+        missing = required - set(row)
+        if missing:
+            raise ValueError(f"channel missing fields: {sorted(missing)}")
+    for field in ("logical_dimm", "ptc_channel", "bmc_temperature_index"):
+        values = [int(row[field]) for row in rows]
+        if sorted(values) != list(range(24)):
+            raise ValueError(f"{field} must be unique 0..23")
+    for index, row in enumerate(rows):
+        lane = index // 6
+        expected_zone = 0 if lane == 0 else (1 if lane in (1, 2) else 2)
+        if int(row["logical_dimm"]) != index:
+            raise ValueError("channel rows must be logical order")
+        if int(row["air_lane"]) != lane or int(row["thermal_zone"]) != expected_zone:
+            raise ValueError(f"lane/zone mismatch at {index}")
+        if int(row["front_fan_channel"]) != lane or int(row["rear_fan_channel"]) != lane:
+            raise ValueError(f"fan mapping mismatch at {index}")
+        if bool(row["primary_cohort"]) != (index < 18):
+            raise ValueError(f"cohort mismatch at {index}")
+        ct = row["ct7428_channel"]
+        if ct != "unknown" and (not isinstance(ct, int) or not 0 <= ct < 27):
+            raise ValueError(f"invalid CT mapping at {index}")
+
+
+def layout(snapshot: dict[str, Any]) -> tuple[list[dict[str, Any]], int]:
+    offset = 0
+    rows: list[dict[str, Any]] = []
+    seen: set[str] = set()
+    for field in snapshot.get("fields", []):
+        name = field["name"]
+        kind = field["type"]
+        count = int(field.get("count", 1))
+        if name in seen or kind not in TYPE_BYTES or count <= 0:
+            raise ValueError(f"invalid snapshot field: {field}")
+        seen.add(name)
+        size = TYPE_BYTES[kind] * count
+        row = dict(field)
+        row.update({"offset": offset, "size": size})
+        rows.append(row)
+        offset += size
+    if offset > int(snapshot["max_payload_bytes"]):
+        raise ValueError(f"snapshot payload {offset} exceeds maximum")
+    return rows, offset
+
+
+def validate_wire(wire: dict[str, Any], snapshot_size: int) -> None:
+    if wire["clock_hz"] != 25_000_000 or wire["device"] != "EF2L45BG256B":
+        raise ValueError("device/clock drift")
+    if wire["host_uart"]["baud"] != 921_600 or wire["bmc_uart"]["baud"] != 115_200:
+        raise ValueError("UART baud drift")
+    if wire["commands"]["SET_TARGET"]["payload_length"] != 1:
+        raise ValueError("SET_TARGET length drift")
+    if wire["responses"]["SNAPSHOT_DATA"].get("payload_length", snapshot_size) != snapshot_size:
+        raise ValueError("snapshot length drift")
+    forbidden = set(wire.get("forbidden_fields", []))
+    if not {"protocol_version", "project_id", "sequence", "nack"}.issubset(forbidden):
+        raise ValueError("forbidden field list incomplete")
+
+
+def crc16(data: bytes) -> int:
+    crc = 0xFFFF
+    for value in data:
+        crc ^= value << 8
+        for _ in range(8):
+            crc = ((crc << 1) ^ 0x1021) & 0xFFFF if crc & 0x8000 else (crc << 1) & 0xFFFF
+    return crc
+
+
+def frame(frame_type: int, payload: bytes) -> str:
+    body = bytes((frame_type, len(payload))) + payload
+    crc = crc16(body)
+    return (b"\xA5\x5A" + body + bytes((crc & 0xFF, crc >> 8))).hex().upper()
+
+
+def json_bytes(value: Any) -> bytes:
+    return (json.dumps(value, indent=2, sort_keys=True, ensure_ascii=False) + "\n").encode()
+
+
+def verilog_header(layout_rows: list[dict[str, Any]], snapshot_size: int, wire: dict[str, Any], coeff: dict[str, Any], fan: dict[str, Any], contract_sha: str) -> bytes:
+    command = wire["commands"]
+    response = wire["responses"]
+    limits = coeff["limits_centi_degC"]
+    target = coeff["targets_centi_degC"]
+    classes = coeff["classes"]
+    lines = [
+        "`ifndef PROD2U_6400_V1_PARAMS_VH",
+        "`define PROD2U_6400_V1_PARAMS_VH",
+        f"// Generated contract SHA-256: {contract_sha}",
+        "`define FB_CLOCK_HZ 25000000",
+        "`define FB_PTC_COUNT 24",
+        "`define FB_FRONT_FAN_COUNT 4",
+        "`define FB_REAR_FAN_COUNT 4",
+        "`define FB_OUTPUT_COUNT 32",
+        "`define FB_BMC_COUNT 24",
+        "`define FB_CT_COUNT 27",
+        "`define FB_PRIMARY_COUNT 18",
+        "`define FB_HOLDOUT_COUNT 6",
+        "`define FB_HOST_BAUD 921600",
+        "`define FB_BMC_BAUD 115200",
+        "`define FB_HOST_FIXED_CLKS_PER_BIT 27",
+        "`define FB_BMC_CLKS_PER_BIT 217",
+        "`define FB_PWM_PHASES 100",
+        "`define FB_PWM_PHASE_CLKS 500",
+        "`define FB_PWM_PERIOD_CLKS 50000",
+        f"`define FB_CMD_SET_TARGET 8'h{int(command['SET_TARGET']['type']):02X}",
+        f"`define FB_CMD_GET_SNAPSHOT 8'h{int(command['GET_SNAPSHOT']['type']):02X}",
+        f"`define FB_CMD_SET_STIMULUS 8'h{int(command['SET_STIMULUS']['type']):02X}",
+        f"`define FB_RSP_SET_TARGET_ACK 8'h{int(response['SET_TARGET_ACK']['type']):02X}",
+        f"`define FB_RSP_SNAPSHOT 8'h{int(response['SNAPSHOT_DATA']['type']):02X}",
+        f"`define FB_RSP_STIMULUS_ACK 8'h{int(response['SET_STIMULUS_ACK']['type']):02X}",
+        f"`define FB_SNAPSHOT_LENGTH {snapshot_size}",
+        f"`define FB_TEMP_SOFT {int(limits['soft'])}",
+        f"`define FB_TEMP_PRETRIP {int(limits['pretrip'])}",
+        f"`define FB_TEMP_HARD {int(limits['hard'])}",
+        f"`define FB_TEMP_DEFAULT_TARGET {int(target['default'])}",
+        f"`define FB_EDGE_KP_Q4_12 {int(classes['EDGE']['kp_q4_12'])}",
+        f"`define FB_EDGE_KI_Q4_12 {int(classes['EDGE']['ki_q4_12'])}",
+        f"`define FB_CENTER_KP_Q4_12 {int(classes['CENTER']['kp_q4_12'])}",
+        f"`define FB_CENTER_KI_Q4_12 {int(classes['CENTER']['ki_q4_12'])}",
+        f"`define FB_FAN_RESET {int(fan['duty']['reset'])}",
+        f"`define FB_FAN_HARD {int(fan['duty']['hard'])}",
+    ]
+    for row in layout_rows:
+        macro = row["name"].upper()
+        lines.append(f"`define FB_SNAPSHOT_{macro}_OFFSET {row['offset']}")
+    lines.extend(["`endif", ""])
+    return "\n".join(lines).encode()
+
+
+def channel_markdown(mapping: dict[str, Any], contract_sha: str) -> bytes:
+    lines = [
+        "# Generated 6400 channel map",
+        "",
+        f"Contract SHA-256: `{contract_sha}`.",
+        "",
+        "| DIMM | CPU slot | Lane | Zone | PTC | BMC | CT | Cohort |",
+        "| ---: | --- | ---: | ---: | ---: | ---: | --- | --- |",
+    ]
+    for row in mapping["channels"]:
+        cohort = "primary" if row["primary_cohort"] else "holdout"
+        lines.append(
+            f"| {row['logical_dimm']} | CPU{row['cpu']}/{row['cpu_slot']} | {row['air_lane']} | "
+            f"{row['thermal_zone']} | {row['ptc_channel']} | {row['bmc_temperature_index']} | "
+            f"{row['ct7428_channel']} | {cohort} |"
+        )
+    lines.extend(["", "CT physical placement is explicitly unknown until board evidence closes it.", ""])
+    return "\n".join(lines).encode()
+
+
+def generate(output: Path) -> dict[Path, bytes]:
+    mapping = load_yaml("channel-map.yaml")
+    wire = load_yaml("6400-wire.yaml")
+    snapshot = load_yaml("6400-snapshot.yaml")
+    fixed = load_yaml("6400-fixed-point.yaml")
+    coeff = load_yaml("controller-coefficients.yaml")
+    fan = load_yaml("fan-control-parameters.yaml")
+    validate_channels(mapping)
+    layout_rows, snapshot_size = layout(snapshot)
+    validate_wire(wire, snapshot_size)
+    contract_sha = source_hash()
+    snapshot_layout = {"schema": snapshot["schema"], "byte_order": "little", "payload_length": snapshot_size, "fields": layout_rows, "contract_sha256": contract_sha}
+    golden = {
+        "schema": "prod2u-6400-golden-vectors-v1",
+        "contract_sha256": contract_sha,
+        "frames": {
+            "set_target_stop": frame(0x01, bytes((0,))),
+            "set_target_20": frame(0x01, bytes((20,))),
+            "set_target_70": frame(0x01, bytes((70,))),
+            "get_snapshot": frame(0x02, b""),
+            "set_target_ack": frame(0x81, b""),
+            "stimulus_all_zero_one_second": frame(0x03, bytes((1,)) + bytes(32)),
+            "stimulus_ack": frame(0x83, b""),
+        },
+    }
+    host = {
+        "schema": "prod2u-6400-host-contract-v1",
+        "contract_sha256": contract_sha,
+        "wire": wire,
+        "snapshot": snapshot_layout,
+        "channel_map": mapping,
+        "fixed_point": fixed,
+        "controller_coefficients": coeff,
+        "fan_control": fan,
+        "golden_vectors": golden,
+    }
+    files = {
+        output / "channel-map.json": json_bytes({**mapping, "contract_sha256": contract_sha}),
+        output / "snapshot-layout.json": json_bytes(snapshot_layout),
+        output / "fixed-point.json": json_bytes({**fixed, "contract_sha256": contract_sha}),
+        output / "controller-coefficients.json": json_bytes({**coeff, "contract_sha256": contract_sha}),
+        output / "fan-control-parameters.json": json_bytes({**fan, "contract_sha256": contract_sha}),
+        output / "golden-vectors.json": json_bytes(golden),
+        output / "host-contract.json": json_bytes(host),
+        output / "prod2u_6400_v1_params.vh": verilog_header(layout_rows, snapshot_size, wire, coeff, fan, contract_sha),
+        output / "contract-sha256.txt": (contract_sha + "\n").encode(),
+        ROOT / "docs/generated/6400-channel-map.md": channel_markdown(mapping, contract_sha),
+    }
+    return files
+
+
+def main() -> int:
+    parser = argparse.ArgumentParser()
+    parser.add_argument("--output", type=Path, default=DEFAULT_OUTPUT)
+    parser.add_argument("--check", action="store_true")
+    args = parser.parse_args()
+    expected = generate(args.output)
+    drift: list[str] = []
+    for path, content in expected.items():
+        if args.check:
+            if not path.exists() or path.read_bytes() != content:
+                drift.append(str(path.relative_to(ROOT)))
+        else:
+            path.parent.mkdir(parents=True, exist_ok=True)
+            if not path.exists() or path.read_bytes() != content:
+                path.write_bytes(content)
+    if drift:
+        print("generated drift: " + ", ".join(drift), file=sys.stderr)
+        return 1
+    print(f"PASS: {len(expected)} generated files")
+    return 0
+
+
+if __name__ == "__main__":
+    try:
+        sys.exit(main())
+    except (KeyError, TypeError, ValueError, yaml.YAMLError) as exc:
+        print(f"ERROR: {exc}", file=sys.stderr)
+        sys.exit(2)