Repository navigation
Conversation
Signed-off-by: Matt Katz <[email protected]>
99a8071 to
854f1a1
Compare
Signed-off-by: Matt Katz <[email protected]>
Signed-off-by: Matt Katz <[email protected]>
Merging this PR will regress 1 benchmark
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | decode_primitives[i64, (1000, 32)] |
24.7 µs | 38.3 µs | -35.54% |
| ⚡ |
Simulation | density_sweep_dense_runs[0.001] |
47.9 µs | 29.9 µs | +60.28% |
| ⚡ |
Simulation | filter_powerlaw_by_mostly_true[250000] |
150.5 µs | 104.1 µs | +44.62% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing mk/for-global-reference (6e089e9) with develop (fdba755)
Footnotes
-
43 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them. ↩
Signed-off-by: Matt Katz <[email protected]>
FoR reference as metadataFoR: store a global reference as metadata
FoR: store a global reference as metadataFoR: store a global reference scalar as metadata rather than child
Summary
A FoR array now has either a global reference, stored as a
ScalarinFoRData, or blocked references, one per 1024-element chunk, stored in an optionalblocked_referenceschild. Previously, a single reference was aConstantArraychild, andconstant_reference()recovered it by downcasting that child.With the reference as metadata, nothing can turn a single-reference array into a different encoding by rewriting its child: casts, optimizer rewrites and compressor passes no longer see a child to rewrite. Kernels read the reference directly instead of downcasting and cloning, and no
ConstantArrayis allocated for slice, take, filter ortry_new.API
FoRData { offset, global_reference: Option<Scalar> }. The references slot is renamed toblocked_references: Option<ArrayRef>.references()returns the newFoRReferencesenum, which replacesconstant_reference():validaterequires exactly one of the two, andoffset == 0with a global reference.FoR::try_new(encoded, reference)builds a global reference.FoR::try_new_chunked(encoded, references, offset)builds blocked references, except that aConstantArrayof references becomes a global reference.FoR::encode_chunkedemits a global reference when every chunk has the same minimum. Previously those references stayed aPrimitiveArray, unless the compressor's constant detection, which only keeps a constant when it is smaller, happened to convert them.