pub enum CodeLength {
Tokens(u64),
Assembly {
instructions: u64,
rodata_lines: u64,
},
Units(u64),
}Expand description
How much code the solver has to read, in the specification’s units.
Non-assembly source is counted in cl100k_base tokens; assembly is counted in lines of
disassembly plus lines of .rodata. Token counting is left to the caller so the crate
stays dependency-free — produce it with tiktoken and pass CodeLength::Tokens.
Variants§
Tokens(u64)
len(tiktoken.get_encoding("cl100k_base").encode(file_data)), summed over relevant files.
Assembly
objdump -d | wc -l plus objdump -s -j .rodata | wc -l.
Fields
Units(u64)
A pre-summed unit count, for mixing source and binary across a challenge.
Implementations§
Trait Implementations§
Source§impl Clone for CodeLength
impl Clone for CodeLength
impl Copy for CodeLength
Source§impl Debug for CodeLength
impl Debug for CodeLength
impl Eq for CodeLength
Source§impl PartialEq for CodeLength
impl PartialEq for CodeLength
impl StructuralPartialEq for CodeLength
Auto Trait Implementations§
impl Freeze for CodeLength
impl RefUnwindSafe for CodeLength
impl Send for CodeLength
impl Sync for CodeLength
impl Unpin for CodeLength
impl UnsafeUnpin for CodeLength
impl UnwindSafe for CodeLength
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more