Best Use & Engineering Application Guide

Engineering Category: Zero-Copy Scanning, Parsing & Codec Primitives

Best Use in Production: High-throughput byte-slice scanning, delimiter discovery, and wire-safe ASCII/hex transcoding inside bounded 64KB memory pages.

When to Select This Capsule: Holds the #1 Equivalence Crown across 2 functionally identical implementations (fastest verified hardware _rdtsc). Sub-10-cycle hardware kernel (1500001/200000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.

Snap-Circuit Wiring Role: Slice Ingress / Scanner Stage `(&[u8],usize)->usize` — digests raw byte buffers into scalar tokens or checksums.

Hardware _rdtsc: 1500001/200000 cycles/op
Latency: 1428697/400000 ns/op
Throughput: 400000000/1428697 ops/us
Compiled ELF64 .text: 63 B (21 x86_64 insns)
C64 64KB RAM Budget: 411/65536 (411 B source)
Ternary Vote: + (score 1) | Salience: 869585/9828
Pure-Rust Capsule Source Code (411 B)
pub fn skip_utf8_char(bytes: &[u8], i: usize) -> usize {
    if i >= bytes.len() {
        return i;
    }
    let b = bytes[i];
    if b < 0x80 {
        return i + 1;
    }
    let len = if b & 0b1111_0000 == 0b1111_0000 {
        4
    } else if b & 0b1110_0000 == 0b1110_0000 {
        3
    } else if b & 0b1100_0000 == 0b1100_0000 {
        2
    } else {
        1
    };
    (i + len).min(bytes.len())
}
rustc -C opt-level=3 x86_64 Disassembly (63 B .text / 21 insns)
skip_utf8_char:
    cmp    rdx, rsi
    jae    .LBB7_7
    movzx    ecx, byte ptr [rdi + rdx]
    test    cl, cl
    js    .LBB7_2
    inc    rdx
.LBB7_7:
    mov    rax, rdx
    ret
.LBB7_2:
    mov    eax, 4
    cmp    cl, -17
    ja    .LBB7_5
    mov    eax, 3
    cmp    cl, -32
    jae    .LBB7_5
    cmp    cl, -64
    mov    eax, 1
    sbb    rax, -1
.LBB7_5:
    add    rax, rdx
    cmp    rsi, rax
    cmovb    rax, rsi
    ret

Head-to-Head Functional Equivalence Class Peers (2 Implementation(s) Matching 64 Test Vectors)

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#640skip_utf8_char (THIS CAPSULE)
domain: hoover-x86_64 | id: 6bd7862f1da208a4ccdcdeb53990512f
1500001/200000 cyc/op1428697/400000 ns/op400000000/1428697 ops/us63 B .text (21 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz
#1230skip_ws
domain: smart-tree | id: 5ceb292afe600d73b788cf4b16bc4b10
2090273/200000 cyc/op995651/200000 ns/op200000000/995651 ops/us60 B .text (14 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz