/** * Two different questions get asked about a device kind and the core, and * conflating them is the failure mode this file exists to prevent: * * 1. Does the TS compiler know how to turn this kind into a program * record (or, for `ground`, into nothing), and does the W0 Rust kernel * know that record's physics? -> CORE_IMPLEMENTED_KINDS. * 2. Has that implementation been PROVEN equivalent to the classic engine * on real circuits, so it is safe to actually route a circuit's * simulation through the core instead of the classic engine? * -> CORE_SUPPORTED_KINDS. * * "Implemented" answers (1); "supported" answers (2). A kind can be * implemented for a long time before it is supported — that gap is * deliberate, not a bug: it is the space the equivalence work happens in. */ /** * Kinds compileCircuit (compile.ts) can turn into a program record, and the * W0 kernel's fixed-node/partition/solve logic (core/README.md, "W0 kernel * semantics") knows the physics of. `ground` is included even though it * compiles to no record at all: it is still a kind the compiler fully * understands, as opposed to one it has never heard of. * * This set is what a circuit is checked against to compile *at all* — it is * not, by itself, permission to run that circuit through the core instead * of the classic engine. See CORE_SUPPORTED_KINDS. */ export declare const CORE_IMPLEMENTED_KINDS: ReadonlySet; /** * Kinds a host on "auto" routes to the core without being told to: * `HeadlessRunner`'s `engine: "auto"` and `"core"`, and the analyses' * `engine: "auto"`, read this list unless the caller passes its own * `coreSupportedKinds`. * * A kind is added here only after it passes all three accuracy gates: * 1. brownout's own analytic-golden and first-principles suites, run * against the core instead of the classic engine * (`pnpm run test:core-suites`); * 2. the dual-engine equivalence harness (core vs. classic, same * circuits, same results within tolerance): the kind's row in the * per-kind table must read "pass", which test/core/equivalence.test.ts * checks for every kind listed here; * 3. the devolt sim/learn/simcore suites, green against the core. * * Promoted 2026-11-13 (rulings D19 and R116) on gate 1 at 327 portable * cases, the per-kind table of that day and devolt's engine matrix. Today * this is every implemented kind: `74ls47`, `clock_gen` and `spdt_switch` * had no passing row in gate 2's table at first (no corpus fixture ran them * on both engines) and joined with fixtures 66, 67 and 68 * (test/fixtures/core), which do. The two lists are still separate on * purpose: a kind a later wave implements starts in CORE_IMPLEMENTED_KINDS * only, and a circuit holding it runs on classic under "auto", with * `unsupported-kind:` as the reason, until it has cleared the gates. * * The engine-selection flag routes a WHOLE circuit to the core only when * every kind that circuit uses is in this set. A circuit with even one * kind missing from CORE_SUPPORTED_KINDS falls back to the classic engine * in full — there is no per-device split between the two engines. */ export declare const CORE_SUPPORTED_KINDS: ReadonlySet; /** * Kind codes for program format v2, mirroring core/src/kinds.rs and the * README's "Kind codes and records" table. The orchestrator owns this table: * it gains a kind's record shape below, and the README row, before the * sub-wave that ports that kind is dispatched. A code without a shape is * reserved; the Rust reader rejects it as -2. */ export declare const CORE_KIND_CODES: { readonly resistor: 1; readonly voltage_source: 2; readonly capacitor: 3; readonly switch: 4; readonly push_button: 5; readonly spdt_switch: 6; readonly dip_switch: 7; readonly potentiometer: 8; readonly trimmer: 9; readonly fuse: 10; readonly ldr: 11; readonly thermistor: 12; readonly ptc_fuse: 13; readonly battery_pack: 20; readonly bench_psu: 21; readonly clock: 22; readonly clock_gen: 23; readonly pulse_source: 24; readonly pulse_gen: 25; readonly section_anchor: 26; readonly led: 30; readonly rgb_led: 31; readonly bicolor_led: 32; readonly seg7_cc: 33; readonly seg7_ca: 34; readonly ne555: 40; readonly "74ls00": 50; readonly "74ls04": 51; readonly "74ls08": 52; readonly "74ls32": 53; readonly "74ls86": 54; readonly "74ls157": 55; readonly "74ls283": 56; readonly "74hc138": 57; readonly "74hc14": 58; readonly "74ls47": 59; readonly cd4511: 60; readonly "74ls245": 61; readonly "74ls161": 70; readonly "74ls173": 71; readonly "74hc74": 72; readonly "74hc595": 73; readonly "74hc165": 74; readonly cd4017: 75; readonly cd4060: 76; readonly "74ls189": 80; readonly "28c16": 81; readonly "28c256": 82; readonly rating: 90; readonly thermal: 91; }; export type CoreKindCodeName = keyof typeof CORE_KIND_CODES; /** A kind's record shape, mirroring core/src/kinds.rs `KindShape`. */ export interface CoreRecordShape { /** Minimum pin count, in the order the README's record-layout table gives. */ pins: number; /** Maximum pin count; equal to `pins` except where the count follows a param (dip_switch). */ pinsMax: number; params: number; /** * Exact blob length, one of two exact lengths (a record with an optional * tail, absent or whole: the 74ls189's preload, `BlobShape::Either`), a * floor for variable-length contents, or a table: `blob[0] = n` and the * blob holds `1 + 2n` values (core/src/kinds.rs `BlobShape::Table`, the * battery's OCV table). */ blob: { exact: number; } | { either: readonly [number, number]; } | { atLeast: number; } | { table: true; }; /** Param indices `bo_engine_set_params` may change after load (owner decision 1). */ liveParams: readonly number[]; /** Digital readout slots a record publishes, starting at `blob[0]` (core/README.md, "Slot indices"). 0 or absent: none. */ digitalSlots?: number; /** * Channel readout slots a record publishes (core/README.md, "Slot indices"). Their base follows the * digital base in the blob, or is `blob[0]` when the kind has no digital slots. 0 or absent: none. */ channelSlots?: number; } /** The params every W1c combinational IC carries, in order (core/README.md, "IC params"; core/src/kinds.rs `ic_param`). */ export declare const CORE_IC_PARAM: { readonly vccMin: 0; readonly vccMax: 1; readonly famFlags: 2; readonly vilFixed: 3; readonly vil: 4; readonly vihFixed: 5; readonly vih: 6; readonly schmitt: 7; readonly vtPlus: 8; readonly vtMinus: 9; readonly nominal: 10; readonly ioMax: 11; readonly delay: 12; }; export declare const CORE_IC_PARAM_COUNT = 13; /** `famFlags` bits and per-logic-pin blob flag bits (core/README.md, "IC params" and "IC blob"). */ export declare const CORE_IC_FAM_TTL = 1; export declare const CORE_IC_FAM_CMOS_RATIO = 2; export declare const CORE_IC_PIN_FLOATING_INPUT = 1; export declare const CORE_IC_PIN_OPEN_COLLECTOR = 2; /** * The delay tail's pairs per kind, in order (core/README.md, "IC delay tail"; * core/src/kinds.rs `delay_pairs`). Pair `k` is params `13 + 2k` (dH) and * `14 + 2k` (dL). A kind absent here has no tail. */ export declare const CORE_IC_DELAY_PAIRS: Readonly>; /** The EEPROMs' params after their delay tail (core/src/kinds.rs `eeprom_param`). */ export declare const CORE_EEPROM_PARAM: { readonly tWC: 23; readonly sdp: 24; }; export declare const CORE_EEPROM_PARAM_COUNT = 25; /** Words in a 74ls189's optional preload, which follows its pin flags in the blob, one nibble per address (core/README.md, "RAM preload"; core/src/kinds.rs `ram_preload_words`). */ export declare const CORE_RAM_189_PRELOAD_WORDS = 16; /** EEPROM image sizes in bytes; the blob carries `size / 4` little-endian words (core/README.md, "ROM image"). */ export declare const CORE_EEPROM_SIZE: Readonly>; /** * LED and display params (core/README.md, "LED and display records"; core/src/kinds.rs `led_param`, * `rgb_param`, `bicolor_param`, `seg7_param`). `led` carries no `ifMax`: its damage limit resolves * exactly as `iRated` does. `seg7` has no `burnt` and no damage limit (Q-O22). */ export declare const CORE_LED_PARAM: { readonly vf: 0; readonly n: 1; readonly iRated: 2; readonly isSet: 3; readonly is: 4; readonly burnt: 5; }; export declare const CORE_LED_PARAM_COUNT = 6; export declare const CORE_RGB_LED_PARAM: { readonly vfR: 0; readonly vfG: 1; readonly vfB: 2; readonly iRated: 3; readonly ifMax: 4; readonly burnt: 5; }; export declare const CORE_RGB_LED_PARAM_COUNT = 6; export declare const CORE_BICOLOR_LED_PARAM: { readonly vf1: 0; readonly vf2: 1; readonly iRated: 2; readonly ifMax: 3; readonly burnt: 4; }; export declare const CORE_BICOLOR_LED_PARAM_COUNT = 5; export declare const CORE_SEG7_PARAM: { readonly vf: 0; readonly iRated: 1; }; export declare const CORE_SEG7_PARAM_COUNT = 2; /** * The battery record's params, in order (core/README.md, "Battery record"; core/src/kinds.rs `battery_param`). * The blob is the OCV table `[n, soc_0, v_0, ..., soc_{n-1}, v_{n-1}]` (`BlobShape::Table`). */ export declare const CORE_BATTERY_PARAM: { readonly ocvScale: 0; readonly rBase: 1; readonly tempFactor: 2; readonly depA: 3; readonly depP: 4; readonly depK: 5; readonly capacityAh: 6; readonly soc0: 7; readonly profileCode: 8; }; export declare const CORE_BATTERY_PARAM_COUNT = 9; /** `profileCode` by classic's profile id (core/README.md, "Battery record" index 8). Rust ignores it; TS reads the id and label from the profile. */ export declare const CORE_BATTERY_PROFILE_CODE: Readonly>; /** The bench PSU's params (core/README.md, "Bench PSU record"; core/src/kinds.rs). `iLimit` 0 is an ideal source. */ export declare const CORE_BENCH_PSU_PARAM: { readonly V: 0; readonly iLimit: 1; }; export declare const CORE_BENCH_PSU_PARAM_COUNT = 2; /** The clock's params (core/README.md, "Waveform source records"). */ export declare const CORE_CLOCK_PARAM: { readonly freq: 0; readonly duty: 1; readonly vHigh: 2; readonly vLow: 3; readonly delay: 4; }; export declare const CORE_CLOCK_PARAM_COUNT = 5; /** The pulse source's params (core/README.md, "Waveform source records"). `per` 0 is a one-shot. */ export declare const CORE_PULSE_PARAM: { readonly v1: 0; readonly v2: 1; readonly td: 2; readonly tr: 3; readonly tf: 4; readonly pw: 5; readonly per: 6; }; export declare const CORE_PULSE_PARAM_COUNT = 7; /** The fuse's params (core/README.md, "Fuse and PTC records"; core/src/kinds.rs). An `iRating <= 0` is no limit. */ export declare const CORE_FUSE_PARAM: { readonly rNormal: 0; readonly iRating: 1; }; export declare const CORE_FUSE_PARAM_COUNT = 2; /** The PTC fuse's params (core/README.md, "Fuse and PTC records"; core/src/kinds.rs). */ export declare const CORE_PTC_FUSE_PARAM: { readonly rNormal: 0; readonly iHold: 1; }; export declare const CORE_PTC_FUSE_PARAM_COUNT = 2; /** The synthetic rating record's params (code 90; core/README.md, "Rating record"). `device` is the resistor's record index. */ export declare const CORE_RATING_PARAM: { readonly device: 0; readonly pMax: 1; readonly rPower: 2; }; export declare const CORE_RATING_PARAM_COUNT = 3; /** The synthetic thermal record's params (code 91; core/README.md, "Thermal record"). `device` is the resistor's or `led`'s record index. */ export declare const CORE_THERMAL_PARAM: { readonly device: 0; readonly rThetaJA: 1; readonly tauS: 2; readonly hasShutdown: 3; readonly tripC: 4; readonly restartC: 5; }; export declare const CORE_THERMAL_PARAM_COUNT = 6; /** Shapes of the kinds ported so far. Grows per sub-wave, in step with core/src/kinds.rs. */ export declare const CORE_RECORD_SHAPES: ReadonlyMap;