← All examples

Not bit fill

simd.fill[value not.bit (5 plus 'v17')] with a uint16 'v17', for a simd[uint16, 8].

not_bit_fill.zg
# Finding 2026-10-05 (check run --borrow-wrong 1000 --avoid none, seeds 24107 and 24126, shrunk and
# cut down by hand): `simd.fill[value not.bit (5 plus 'v17')]` with a uint16 'v17', for a simd[uint16, 8].
# The width comes from any operand whose type is known (owner: a, 2026-09-23), here 'v17', and the
# lanes are uint16 besides. The oracle stops: "`not.bit` flips a type's bits, so it needs to know how
# many". With ('v17' plus 5) it runs, as it does for not.bit (5 plus 'v17') in a comparison or a
# print: inside simd.fill it looks at the left operand only. Zomp runs it.
# check claude generator, seed 24126
extern.C fn write ['fd': int32, 'buf': ptr[uint8], 'len': uint64] -> int64;

fn emit ['m': uint64, 'neg': bool] {
    let mut 'buf': list[uint8] = [];
    if 'neg' { list.append[lend.mut 'buf', value 45]; }
    let mut 'v': uint64 = 'm';
    let mut 'ds': list[uint8] = [];
    list.append[lend.mut 'ds', value to.uint8[48 plus ('v' mod.floor 10)]];
    change 'v' = 'v' div.floor 10;
    while 'v' > 0 {
        list.append[lend.mut 'ds', value to.uint8[48 plus ('v' mod.floor 10)]];
        change 'v' = 'v' div.floor 10;
    }
    let mut 'k': uint64 = list.length[lend 'ds'];
    while 'k' at_least 1 {
        list.append[lend.mut 'buf', value 'ds'[pos 'k']];
        change 'k' = 'k' minus 1;
    }
    list.append[lend.mut 'buf', value 10];
    no_check write[1, lend 'buf', list.length[lend 'buf']];
}

fn put_u ['n': uint64] {
    emit['n', false];
}

fn put_i ['n': int64] {
    if 'n' < 0 {
        emit[to.uint64[0 minus ('n' plus 1)] plus 1, true];
    } else {
        emit[to.uint64['n'], false];
    }
}
MAIN {
    let 'v17': uint16 = 0;
    let 's21': simd[uint16, 8] = simd.fill[value not.bit (5 plus 'v17')];
    put_u[to.uint64[simd.max['s21']]];
}
Output
65530