Engineering Category: Lossless Wire & Structural Compression
Best Use in Production: Zero-allocation integer bit-packing, variable-length encoding, and stream framing for sovereign wire protocols.
When to Select This Capsule: Sole canonical implementation for its 64-vector functional equivalence class. Low-latency L1-resident kernel (1135551/40000 cyc/op); well-suited for high-frequency pipeline stages.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(usize)->usize` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 87 B (29 x86_64 insns)162 B)pub fn line_number_width(max_line_number: usize) -> usize {
if max_line_number == 0 {
1
} else {
max_line_number.to_string().len()
}
}
rustc -C opt-level=3 x86_64 Disassembly (87 B .text / 29 insns)line_number_width:
push rbx
sub rsp, 32
test rdi, rdi
je .LBB7_1
lea rsi, [rsp + 12]
mov edx, 20
call qword ptr [rip + _RNvMsk_NtNtNtCscNqnBmBaIcL_4core3fmt3num3impj4__fmt@GOTPCREL]
mov rbx, rdx
test rdx, rdx
js .LBB7_7
je .LBB7_4
call qword ptr [rip + _RNvCs19qJvbSQqYX_7___rustc35___rust_no_alloc_shim_is_unstable_v2@GOTPCREL]
mov rax, rbx
add rsp, 32
pop rbx
ret
.LBB7_1:
mov ebx, 1
mov rax, rbx
add rsp, 32
pop rbx
ret
.LBB7_4:
xor ebx, ebx
mov rax, rbx
add rsp, 32
pop rbx
ret
.LBB7_7:
xor edi, edi
mov rsi, rbx
call qword ptr [rip + _RNvNtCseyxFaS8hpVE_5alloc7raw_vec12handle_error@GOTPCREL]
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #1693 | line_number_width (THIS CAPSULE) domain: smart-tree | id: 71924100ee35807b298a527c4cdf3d0f | 1135551/40000 cyc/op | 1081629/80000 ns/op | 80000000/1081629 ops/us | 87 B .text (29 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |