✓
Passing This code compiles and runs correctly.
Code
// MIRROR of 2109_prime_sieve_generated: `std/field:mark-multiples`, which emits
// a fully-unrolled per-stride marker at compile time, relocated into an
// imported module.
//
// 115_004 pins field:new on the boundary; this pins the library's generating
// transform, the one that bakes masks as immediate literals. Whether the two
// share a fault or fail separately is what the pair is for.
import app/lib
app/lib:run()
Supporting Files
import std/io
import std/field
pub tor run {}
run = std/field:new(bits: 500000)
| field f |> for(1..500)
! each i |> std/field:test(f, i): pv |> if(pv == 0)
| then |> std/field:mark-multiples(f, from: 2 * i * (i + 1), stride: 2 * i + 1, limit: 499999)
| done |> std/field:count-zeros(f, lo: 1, hi: 500000): c |> std/io:print.ln("{{ c + 1:d }}") |> std/field:free(f)
| err e |> std/io:print.ln("ERR {{ e:s }}")
Actual
78498
Expected output
78498
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN