rustc -C opt-level=3): 2049 (203973 B .text / 53737 insns)22/9 Hz): 248859 B / 5979025 B (ratio 19143/459925, saved 440782/459925, 11708 ″ dittos)| Rank & Crown | Function Name & Domain | Best Use & Snap-Circuit Role | Pin Signature & 64-Vec Hash | Hardware _rdtsc (p/q) | Details & Quick Peek |
|---|---|---|---|---|---|
| #14 SOLE CROWN #1 <10 CYC | saturate_trit_i64 domain: ternary | id: 9bb078d59c28Aye: aye::Peter+Omni(0+1)::aarch64 @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. Specialized Multi-Pin Stage `(i64)->i8` — wire matching input pins via `snap_dag` or `snap_pipeline`. | (i64)->i864-vec BLAKE3: 479f392c99dcC64 RAM: 19/4096 (304 B src) | 1323467/400000 cyc/op 206833/200000 ns/op | 200000000/206833 ops/us 12 B .text (5 insns) | Trit + (1) | Inspect Details & ASM →Quick Peek Rust (304 B)pub fn saturate_trit_i64(value: i64) -> i8 {
// Project an arbitrary accumulator onto the ternary alphabet {-1, 0, +1}.
// Branch-free: two arithmetic compares compiled to cmp/setcc pairs.
if value > 1 {
1
} else if value < -1 {
-1
} else {
value as i8
}
} |
| #20 CROWN #1 of 2 <10 CYC | tnand domain: ternary | id: b0b7b00d6353Aye: aye::Peter+Omni(0+1)::aarch64 @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. Specialized Multi-Pin Stage `(i8,i8)->i8` — wire matching input pins via `snap_dag` or `snap_pipeline`. | (i8,i8)->i864-vec BLAKE3: fd5753da6279C64 RAM: 21/16384 (84 B src) | 784867/200000 cyc/op 24527/20000 ns/op | 20000000/24527 ops/us 11 B .text (5 insns) | Trit + (1) | Inspect Details & ASM →Quick Peek Rust (84 B)pub fn tnand(a: i8, b: i8) -> i8 {
let lo = if a < b { a } else { b };
-lo
} |
| #31 SOLE CROWN #1 <10 CYC | trit_at_u8 domain: ternary | id: 325d74c8ecd6Aye: aye::Peter+Omni(0+1)::aarch64 @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. Specialized Multi-Pin Stage `(u8,u32)->i8` — wire matching input pins via `snap_dag` or `snap_pipeline`. | (u8,u32)->i864-vec BLAKE3: 0979202d4edbC64 RAM: 347/65536 (347 B src) | 953933/200000 cyc/op 298229/200000 ns/op | 200000000/298229 ops/us 49 B .text (15 insns) | Trit + (1) | Inspect Details & ASM →Quick Peek Rust (347 B)pub fn trit_at_u8(byte: u8, index: u32) -> i8 {
// Digit extraction from a 5-trit byte (3^5 = 243 < 256). Bounded: any index
// outside the 5 lanes reads the zero-pad lane instead of looping.
const POW3: [u32; 5] = [1, 3, 9, 27, 81];
let i = if index < 5 { index as usize } else { 4 };
((byte as u32 / POW3[i]) % 3) as i8 - 1
} |
| #45 CROWN #1 of 300 <10 CYC | st_golf_steward_wifakerf_ternary_gate_pack_i64 domain: wifakerf-ternary | id: bcfa46cb01fbAye: aye::Hue+Gemini(0+1)::x86_64 @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. Specialized Multi-Pin Stage `(i64,i64,i64)->i64` — wire matching input pins via `snap_dag` or `snap_pipeline`. | (i64,i64,i64)->i6464-vec BLAKE3: bc0951af632bC64 RAM: 397/65536 (397 B src) | 69693/10000 cyc/op 94539/50000 ns/op | 50000000/94539 ops/us 121 B .text (39 insns) | Trit + (1) | Inspect Details & ASM →Quick Peek Rust (397 B)pub const fn st_golf_steward_wifakerf_ternary_gate_pack_i64(a: i64, b: i64, threshold: i64) -> i64 {
let th = if threshold.abs() < 1 { 1 } else { threshold.abs() };
let d = a.wrapping_sub(b);
let t0 = 1 + ((a > th) as i64) - ((a < -th) as i64);
let t1 = 1 + ((b > th) as i64) - ((b < -th) as i64);
let t2 = 1 + ((d > th) as i64) - ((d < -th) as i64);
t0 * 9 + t1 * 3 + t2
} |
| #71 SOLE CROWN #1 <10 CYC | borg_c99_gaia_trit_pack domain: ternary | id: ddfa78212eb6Aye: aye-a6000-prime @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 1-to-1 Unary Transform Stage `(u64)->u64` — snaps directly into linear pipelines or fan-out DAG branches. | (u64)->u6464-vec BLAKE3: fd8bc4855fbeC64 RAM: 495/65536 (495 B src) | 302049/40000 cyc/op 100683/40000 ns/op | 40000000/100683 ops/us 329 B .text (80 insns) | Trit + (1) | Inspect Details & ASM →Quick Peek Rust (495 B)pub fn borg_c99_gaia_trit_pack(word: u64) -> u64 {
const POW3: [u64; 5] = [1, 3, 9, 27, 81];
let mut packed: u64 = 0;
let mut lane: usize = 0;
while lane < 5 {
let cell = ((word >> (lane as u32 * 12)) & 0xFFF) as i64 - 2048;
let trit: i8 = (cell > 256) as i8 - (cell < -256) as i8;
let tu = trit as u8;
let digit = tu.wrapping_add((tu >> 7).wrapping_mul(3)) as u64;
packed += digit * POW3[lane];
lane += 1;
}
packed ^ 432
} |
| #99 PEER of 306 <10 CYC | steward_ternary_pq_multilayer_wupz_witness_step domain: ternary-pq-multilayer | id: 7e943ef951d7Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(u64,u64)->u64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (u64,u64)->u6464-vec BLAKE3: 68d052c83838C64 RAM: 137/32768 (274 B src) | 274687/50000 cyc/op 355159/200000 ns/op | 200000000/355159 ops/us 45 B .text (10 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (274 B)#[inline(always)]
pub fn steward_ternary_pq_multilayer_wupz_witness_step(acc: u64, word: u64) -> u64 {
let mixed = acc ^ word.wrapping_mul(0x9E37_79B9_7F4A_7C15);
let rot = mixed.rotate_left(17) ^ mixed.rotate_right(11);
rot.wrapping_add(0x5755_505A_0432_0528)
} |
| #110 PEER of 306 <10 CYC | steward_ternary_pq_text_pilot_wupz_witness_step domain: ternary-pq-text-pilot | id: b5f9163ead67Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(u64,u64)->u64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (u64,u64)->u6464-vec BLAKE3: 68d052c83838C64 RAM: 137/32768 (274 B src) | 2197497/400000 cyc/op 88791/50000 ns/op | 50000000/88791 ops/us 45 B .text (10 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (274 B)#[inline(always)]
pub fn steward_ternary_pq_text_pilot_wupz_witness_step(acc: u64, word: u64) -> u64 {
let mixed = acc ^ word.wrapping_mul(0x9E37_79B9_7F4A_7C15);
let rot = mixed.rotate_left(17) ^ mixed.rotate_right(11);
rot.wrapping_add(0x5755_505A_0432_0528)
} |
| #274 PEER of 306 <10 CYC | steward_ternary_lane_wupz_witness_step domain: ternary-lane | id: df7c77552a82Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(u64,u64)->u64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (u64,u64)->u6464-vec BLAKE3: 68d052c83838C64 RAM: 265/65536 (265 B src) | 1071329/200000 cyc/op 346303/200000 ns/op | 200000000/346303 ops/us 45 B .text (10 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (265 B)#[inline(always)]
pub fn steward_ternary_lane_wupz_witness_step(acc: u64, word: u64) -> u64 {
let mixed = acc ^ word.wrapping_mul(0x9E37_79B9_7F4A_7C15);
let rot = mixed.rotate_left(17) ^ mixed.rotate_right(11);
rot.wrapping_add(0x5755_505A_0432_0528)
} |
| #517 PEER of 303 <10 CYC | steward_ternary_pq_multilayer_geodesic_seat_ema domain: ternary-pq-multilayer | id: fff177a41dbfAye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(i64,i64)->i64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (i64,i64)->i6464-vec BLAKE3: f79426b0bb51C64 RAM: 115/32768 (230 B src) | 2635093/400000 cyc/op 212989/100000 ns/op | 100000000/212989 ops/us 67 B .text (17 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (230 B)#[inline(always)]
pub fn steward_ternary_pq_multilayer_geodesic_seat_ema(prev_cm: i64, obs_cm: i64) -> i64 {
let ema_cm = (prev_cm.wrapping_mul(3).wrapping_add(obs_cm)) / 4;
(ema_cm.wrapping_mul(10_000_000)) / 11_113_300
} |
| #526 PEER of 303 <10 CYC | steward_ternary_pq_text_pilot_geodesic_seat_ema domain: ternary-pq-text-pilot | id: 6d249fe47ccfAye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(i64,i64)->i64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (i64,i64)->i6464-vec BLAKE3: f79426b0bb51C64 RAM: 115/32768 (230 B src) | 2761697/400000 cyc/op 892693/400000 ns/op | 400000000/892693 ops/us 67 B .text (17 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (230 B)#[inline(always)]
pub fn steward_ternary_pq_text_pilot_geodesic_seat_ema(prev_cm: i64, obs_cm: i64) -> i64 {
let ema_cm = (prev_cm.wrapping_mul(3).wrapping_add(obs_cm)) / 4;
(ema_cm.wrapping_mul(10_000_000)) / 11_113_300
} |
| #584 SOLE CROWN #1 <10 CYC | ospop_pack5 domain: ternary | id: 1aa4c4c12cfeAye: aye::Hue+Gemini(0+1)::aarch64 @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 1-to-1 Unary Transform Stage `(u64)->u64` — snaps directly into linear pipelines or fan-out DAG branches. | (u64)->u6464-vec BLAKE3: bf3021ead010C64 RAM: 487/65536 (487 B src) | 1/1 cyc/op 752833/200000 ns/op | 200000000/752833 ops/us 165 B .text (45 insns) | Trit + (1) | Inspect Details & ASM →Quick Peek Rust (487 B)pub fn ospop_pack5(word: u64) -> u64 {
const POW3: [u64; 5] = [1, 3, 9, 27, 81];
let mut byte: u64 = 0;
let mut lane = 0usize;
while lane < 5 {
// Two's-complement ternary: 0 -> 0, 1 -> 1, -1 -> 255 (0xFF)
let tu = ((word >> (lane * 8)) as u8) as i64;
let trit = if tu > 1 { 1 } else if tu == 255 || tu == 0xFF { -1 } else { tu as i8 };
let digit = (trit + 1) as u64;
byte += digit * POW3[lane];
lane += 1;
}
byte
} |
| #587 SOLE CROWN #1 <10 CYC | ospop_a6p_delta domain: ternary | id: 415d71225ca4Aye: aye::Hue+Gemini(0+1)::aarch64 @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. Specialized Multi-Pin Stage `(u8)->i64` — wire matching input pins via `snap_dag` or `snap_pipeline`. | (u8)->i6464-vec BLAKE3: 4b6e1de07f79C64 RAM: 183/65536 (183 B src) | 1/1 cyc/op 5973/1600 ns/op | 1600000/5973 ops/us 29 B .text (9 insns) | Trit + (1) | Inspect Details & ASM →Quick Peek Rust (183 B)pub fn ospop_a6p_delta(level: u8) -> i64 {
// A6P detail level 0..14 -> 16384 down to 1; anything else clamps to 1.
if level >= 14 { 1 } else { 1i64 << (14 - level as u32) }
} |
| #693 PEER of 312 <10 CYC | steward_ternary_pq_multilayer_kompress_ditto_stride domain: ternary-pq-multilayer | id: a7c3d7afa6d4Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(u64,u64)->u64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (u64,u64)->u6464-vec BLAKE3: 012de5dc0aa5C64 RAM: 131/32768 (262 B src) | 3466079/400000 cyc/op 280093/100000 ns/op | 100000000/280093 ops/us 122 B .text (30 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (262 B)#[inline(always)]
pub fn steward_ternary_pq_multilayer_kompress_ditto_stride(prev_cell: u64, curr_cell: u64) -> u64 {
let delta = prev_cell ^ curr_cell;
let pop = delta.count_ones() as u64;
if pop == 0 { 22 } else { (pop.wrapping_mul(22)) / 9 + 1 }
} |
| #724 PEER of 312 <10 CYC | steward_ternary_lane_kompress_ditto_stride domain: ternary-lane | id: 9ee3ea4d0141Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(u64,u64)->u64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (u64,u64)->u6464-vec BLAKE3: 012de5dc0aa5C64 RAM: 253/65536 (253 B src) | 433093/50000 cyc/op 1119869/400000 ns/op | 400000000/1119869 ops/us 122 B .text (30 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (253 B)#[inline(always)]
pub fn steward_ternary_lane_kompress_ditto_stride(prev_cell: u64, curr_cell: u64) -> u64 {
let delta = prev_cell ^ curr_cell;
let pop = delta.count_ones() as u64;
if pop == 0 { 22 } else { (pop.wrapping_mul(22)) / 9 + 1 }
} |
| #894 PEER of 303 <10 CYC | steward_ternary_lane_geodesic_seat_ema domain: ternary-lane | id: 65ba1379528fAye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(i64,i64)->i64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (i64,i64)->i6464-vec BLAKE3: f79426b0bb51C64 RAM: 221/65536 (221 B src) | 889049/100000 cyc/op 574879/200000 ns/op | 200000000/574879 ops/us 67 B .text (17 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (221 B)#[inline(always)]
pub fn steward_ternary_lane_geodesic_seat_ema(prev_cm: i64, obs_cm: i64) -> i64 {
let ema_cm = (prev_cm.wrapping_mul(3).wrapping_add(obs_cm)) / 4;
(ema_cm.wrapping_mul(10_000_000)) / 11_113_300
} |
| #909 PEER of 312 <10 CYC | steward_ternary_pq_text_pilot_kompress_ditto_stride domain: ternary-pq-text-pilot | id: b0301d5cd003Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(u64,u64)->u64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (u64,u64)->u6464-vec BLAKE3: 012de5dc0aa5C64 RAM: 131/32768 (262 B src) | 182001/20000 cyc/op 589041/200000 ns/op | 200000000/589041 ops/us 122 B .text (30 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (262 B)#[inline(always)]
pub fn steward_ternary_pq_text_pilot_kompress_ditto_stride(prev_cell: u64, curr_cell: u64) -> u64 {
let delta = prev_cell ^ curr_cell;
let pop = delta.count_ones() as u64;
if pop == 0 { 22 } else { (pop.wrapping_mul(22)) / 9 + 1 }
} |
| #1179 PEER of 300 | steward_ternary_lane_ternary_gate_pack domain: ternary-lane | id: b110e8ad3b9bAye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. Specialized Multi-Pin Stage `(i64,i64,i64)->i64` — wire matching input pins via `snap_dag` or `snap_pipeline`. | (i64,i64,i64)->i6464-vec BLAKE3: bc0951af632bC64 RAM: 103/16384 (412 B src) | 182063/16000 cyc/op 735631/200000 ns/op | 200000000/735631 ops/us 109 B .text (32 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (412 B)#[inline(always)]
pub fn steward_ternary_lane_ternary_gate_pack(a: i64, b: i64, threshold: i64) -> i64 {
let th = threshold.abs().max(1);
let t0: i64 = if a > th { 2 } else if a < -th { 0 } else { 1 };
let t1: i64 = if b > th { 2 } else if b < -th { 0 } else { 1 };
let diff = a.wrapping_sub(b);
let t2: i64 = if diff > th { 2 } else if diff < -th { 0 } else { 1 };
t0 * 9 + t1 * 3 + t2
} |
| #1286 PEER of 300 | steward_ternary_pq_text_pilot_ternary_gate_pack domain: ternary-pq-text-pilot | id: fe5dc09f70d5Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. Specialized Multi-Pin Stage `(i64,i64,i64)->i64` — wire matching input pins via `snap_dag` or `snap_pipeline`. | (i64,i64,i64)->i6464-vec BLAKE3: bc0951af632bC64 RAM: 421/65536 (421 B src) | 180513/16000 cyc/op 729311/200000 ns/op | 200000000/729311 ops/us 109 B .text (32 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (421 B)#[inline(always)]
pub fn steward_ternary_pq_text_pilot_ternary_gate_pack(a: i64, b: i64, threshold: i64) -> i64 {
let th = threshold.abs().max(1);
let t0: i64 = if a > th { 2 } else if a < -th { 0 } else { 1 };
let t1: i64 = if b > th { 2 } else if b < -th { 0 } else { 1 };
let diff = a.wrapping_sub(b);
let t2: i64 = if diff > th { 2 } else if diff < -th { 0 } else { 1 };
t0 * 9 + t1 * 3 + t2
} |
| #1364 PEER of 302 | steward_ternary_pq_text_pilot_pq_harmonic_fold domain: ternary-pq-text-pilot | id: c912a61c0482Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(i64,i64)->i64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (i64,i64)->i6464-vec BLAKE3: f3c9e53b4edeC64 RAM: 133/32768 (266 B src) | 4472369/400000 cyc/op 289131/80000 ns/op | 80000000/289131 ops/us 63 B .text (17 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (266 B)#[inline(always)]
pub fn steward_ternary_pq_text_pilot_pq_harmonic_fold(p: i64, q: i64) -> i64 {
let den = if q == 0 { 1 } else { q.abs() };
let num = p.wrapping_mul(432).wrapping_add(den.wrapping_mul(528));
(num ^ (num >> 13)).wrapping_rem(den.max(1))
} |
| #1473 PEER of 302 | steward_ternary_pq_multilayer_pq_harmonic_fold domain: ternary-pq-multilayer | id: 9e937a35a4f9Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 2-to-1 Binary Combiner / Join Stage `(i64,i64)->i64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (i64,i64)->i6464-vec BLAKE3: f3c9e53b4edeC64 RAM: 133/32768 (266 B src) | 2246043/200000 cyc/op 725969/200000 ns/op | 200000000/725969 ops/us 63 B .text (17 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (266 B)#[inline(always)]
pub fn steward_ternary_pq_multilayer_pq_harmonic_fold(p: i64, q: i64) -> i64 {
let den = if q == 0 { 1 } else { q.abs() };
let num = p.wrapping_mul(432).wrapping_add(den.wrapping_mul(528));
(num ^ (num >> 13)).wrapping_rem(den.max(1))
} |
| #1543 SOLE CROWN #1 | ternary_dot_packed domain: ternary | id: ab34bfb18eb3Aye: aye::Peter+Omni(0+1)::aarch64 @ 432Hz | Balanced Ternary & b158 Quantization High-speed ternary dot-product accumulation without integer multiplier bottlenecks; ideal for b158 neural weights and low-bit attention inner loops. 2-to-1 Binary Combiner / Join Stage `(i64,i64)->i64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion. | (i64,i64)->i6464-vec BLAKE3: c26bcea03494C64 RAM: 1035/65536 (1035 B src) | 3475467/200000 cyc/op 2172623/400000 ns/op | 400000000/2172623 ops/us 198 B .text (44 insns) | Trit + (1) | Inspect Details & ASM →Quick Peek Rust (1035 B)/// Dot product of eight ternary lanes packed into one machine word, without
/// multiplying.
///
/// Each byte is a trit: 0x01 (+1), 0x00 (0) or 0xFF (-1). Both the +1 and the
/// -1 lanes have a set low bit, so the negative lanes are cleared out before a
/// lane is read as +1 -- missing that is the classic packed-ternary bug.
///
/// `+1 * +1` and `-1 * -1` are +1, a mismatched sign is -1, a zero lane is 0,
/// so the whole product is two AND masks per outcome and two popcounts. No
/// multiply, no widening, no table, identical on every architecture: the
/// portable twin of a NEON int8 dot.
pub fn ternary_dot_packed(a: i64, b: i64) -> i64 {
const LANE_ONE: i64 = 0x0101_0101_0101_0101;
let a_neg = (a >> 7) & LANE_ONE;
let b_neg = (b >> 7) & LANE_ONE;
let a_one = a & LANE_ONE & !a_neg;
let b_one = b & LANE_ONE & !b_neg;
let positive = (a_one & b_one) | (a_neg & b_neg);
let negative = (a_one & b_neg) | (a_neg & b_one);
i64::from(positive.count_ones()) - i64::from(negative.count_ones())
} |
| #1821 PEER of 312 | steward_ternary_pq_multilayer_isqrt_salience_step domain: ternary-pq-multilayer | id: 4ee081134c9bAye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 1-to-1 Unary Transform Stage `(u64)->u64` — snaps directly into linear pipelines or fan-out DAG branches. | (u64)->u6464-vec BLAKE3: 0aab703b121aC64 RAM: 337/65536 (337 B src) | 64329743/400000 cyc/op 324861/6250 ns/op | 6250000/324861 ops/us 126 B .text (34 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (337 B)#[inline(always)]
pub fn steward_ternary_pq_multilayer_isqrt_salience_step(energy_q15: u64) -> u64 {
let mut x = energy_q15 | 1;
let mut y = (x + 1) >> 1;
let mut iter = 0u32;
while y < x && iter < 12 {
x = y;
y = (x + energy_q15 / x.max(1)) >> 1;
iter += 1;
}
(x.wrapping_mul(432)) >> 4
} |
| #2020 PEER of 312 | steward_ternary_lane_isqrt_salience_step domain: ternary-lane | id: 61639cec637fAye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 1-to-1 Unary Transform Stage `(u64)->u64` — snaps directly into linear pipelines or fan-out DAG branches. | (u64)->u6464-vec BLAKE3: 0aab703b121aC64 RAM: 41/8192 (328 B src) | 31336381/200000 cyc/op 4052233/80000 ns/op | 80000000/4052233 ops/us 126 B .text (34 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (328 B)#[inline(always)]
pub fn steward_ternary_lane_isqrt_salience_step(energy_q15: u64) -> u64 {
let mut x = energy_q15 | 1;
let mut y = (x + 1) >> 1;
let mut iter = 0u32;
while y < x && iter < 12 {
x = y;
y = (x + energy_q15 / x.max(1)) >> 1;
iter += 1;
}
(x.wrapping_mul(432)) >> 4
} |
| #2033 PEER of 312 | steward_ternary_pq_text_pilot_isqrt_salience_step domain: ternary-pq-text-pilot | id: 4c23182ed4b0Aye: alexiai-tokyo-steward @ 432Hz | Balanced Ternary & b158 Quantization Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines. 1-to-1 Unary Transform Stage `(u64)->u64` — snaps directly into linear pipelines or fan-out DAG branches. | (u64)->u6464-vec BLAKE3: 0aab703b121aC64 RAM: 337/65536 (337 B src) | 14604751/80000 cyc/op 2950261/50000 ns/op | 50000000/2950261 ops/us 126 B .text (34 insns) | Trit 0 (0) | Inspect Details & ASM →Quick Peek Rust (337 B)#[inline(always)]
pub fn steward_ternary_pq_text_pilot_isqrt_salience_step(energy_q15: u64) -> u64 {
let mut x = energy_q15 | 1;
let mut y = (x + 1) >> 1;
let mut iter = 0u32;
while y < x && iter < 12 {
x = y;
y = (x + energy_q15 / x.max(1)) >> 1;
iter += 1;
}
(x.wrapping_mul(432)) >> 4
} |