abc/BIT.h — u1 bit type, bitmap slice/buffer, word-parallel set algebra
abc/ has no bitmap type — bit sets are ad-hoc BitAt/BitSet/BitUnset over a raw u8b (abc/BUF.h), abc/NFA.h rolls its own char-class bitmaps, and BitUnset is BROKEN (|= not &=, so clearing fd N's bit SETS up to 7 others — live in FILE_RW, abc/FILE.c). Add abc/BIT.h: a u1 bit type with the typed-slice surface (u1s/u1cs/u1b; u1At/u1sSet/u1sClr/u1sLen; the u1b* buffer family) plus word-parallel set algebra. Replaces the ad-hoc bit fiddling, kills the BitUnset bug by construction, and backs DOG-001's weavescope.
abc/BUF.h:126-145 BitAt/BitSet/BitUnset over u8b, byte-addressed
(ndx>>3,ndx&7); no slice/buffer type, no popcount/union/iterate.
BitUnset is buggy: Bat |= ~(1<<bit) SETS every other bit instead of
clearing the target. Live callers: abc/FILE.c:627,660,778,1063 (FILE_RW).
abc/NFA.h stores character-class bitmaps inline (NFA_CLASS), hand-rolled.weavescope (active-commit set) needs a bitmap + UNION to model"a merge covers the union of its parents' closures".
abc/BIT.h: u1 (bit value) + u1s/u1cs bit-slice + u1b bit buffer;
u1At/u1sSet/u1sClr/u1sPut/u1sLen; u1b family mirroring Bx.h.
u1sOr/u1sAnd/u1sAndNot/u1sXor/u1sCount
(popcount) / u1sNext (next set bit → iterate) / u1sEq / u1sAny.
BitAt/Set/Unset callers (incl. FILE_RW) to u1; the
BitUnset bug vanishes (no broken clear exists in the new API).
u1 is NOT byte-addressable: u1s is a bespoke {u8* base; u32 nbits}
struct, NOT an Sx.h/Bx.h instance — only u1* typed fns, no $-macros.
BitAt); mask the
partial tail word in Count/Or/And so junk bits never count.
(needing shifts) are out of scope until a real use appears.
abc/ change — review-gated (abc-changes-need-review); keep it additive,
don't break BitAt/BitSet until callers migrate.
u64 words; u1sOr/And work 64 bits at a time with a scalar
tail. u1sNext powers a u1$for(i, set) set-bit iterator.
BitAt/BitSet working during migration; delete BitUnset once
FILE_RW moves to u1sClr — the bug dies with it.
(BUF.h shims, the 4 FILE_RW sites; NFA optional, defer if it widens scope).
abc/BIT.h + impl: u1/u1s/u1cs/u1b, element + buffer family.Or/And/AndNot/Xor/Count/Next/Eq/Any, tail-masked.abc/INDEX.md entry.FILE_RW (abc/FILE.c) to u1sSet/u1sClr; drop BitUnset.abc/NFA.h class bitmaps; leave if it widens scope.abc/ change; coordinate with the abc/ owner. Independent ofthe DOG line (disjoint files), runs in its own tree.