census: optional column dump, so a consumer can answer the SIMD question - #14
Conversation
`r2il::columns` states that whether vectorizing its scans pays "is a profiling question nobody has answered", and that the crate takes no ndarray dependency on purpose — the consumer holds one. That left no way to get real columns out of a real lift into such a consumer. Adds an env-gated dump (WIN32_CENSUS_COLUMNS_OUT, default off, no behaviour change when unset) writing the three columns in a flat LE form: u64 n, n*u8 tag, n*u8 space, n*u64 offset. Measured with it (ndarray's r2il_column_scan_probe, Xeon avx512f/bw/vl): on this fixture's 12 408 p-code ops the mask arms run 1.32-1.42x the scalar scan, the advantage inverts to 0.75-0.80x above ~200 K ops, and the whole-census saving is 2.5 us against a lift that costs milliseconds. The columns' own doc-comment caution was right. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCfrD5y19cvFc4AoyydXYv
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Win32 census example now optionally exports projected operation data to a file specified by ChangesWin32 census column export
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
A rabbit found columns in rows, Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_94e5adbd-0d08-4750-add1-12a94894b158) |
r2il::columnsstates that whether vectorizing its scans pays "is a profiling question nobody has answered", and that the crate takes nondarraydependency on purpose — the consumer holds one. That left no way to get real columns out of a real lift and into such a consumer.What this adds
An env-gated dump in the
win32_censusexample —WIN32_CENSUS_COLUMNS_OUT=<path>, default off, zero behaviour change when unset — writing the three columns in a flat LE form:u64 n,n×u8tag,n×u8space,n×u64offset.It is deliberately the smallest possible change: no
ndarrayedge is created anywhere in this workspace, andr2il's dependency surface is untouched.What it was used for
AdaWorldAPI/ndarray#308 consumes the dump and answers the question on this fixture's 12 408 p-code ops (four arms — scalar over the native
u8/u64columns,mask_and,mask_ternlog::<AND3>, and the_underchain — all gated bit-for-bit identical before timing, swept 256 → 3.2 M):u32while these columns areu8, so a consumer pays a 4× widened copy;Also measured, and it bears on
find_ram_in_rangedirectly: 100 % of Ram-space offsets in this lift exceed 2³² (image-based,0x1_4000_105e…0x1_4000_8398), andndarray's ordered comparator family stops ati32— so that query has no general vectorized spelling today without au64range primitive.The columns' own doc-comment caution was right, and is now measured rather than assumed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DCfrD5y19cvFc4AoyydXYv
Summary by CodeRabbit
WIN32_CENSUS_COLUMNS_OUTto export operation counts, tags, spaces, and offsets to a specified file.