Skip to content

Implement compare for map types - #9317

Merged
robert3005 merged 1 commit into
developfrom
claude/map-type-comparison-a7209a
Aug 10, 2026
Merged

Implement compare for map types#9317
robert3005 merged 1 commit into
developfrom
claude/map-type-comparison-a7209a

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

Found by fuzzer in #9297. Map type comparison can delegate to the underlying list type

`compare` bailed with "compare is not supported for dtype map(..)" for any
map-typed operand, which the `file_io` fuzz target hit when verifying a
round-trip by comparing the read-back array against the original.

A map row is the ordered sequence of its non-null `{key, value}` entry
structs, so it compares exactly like a list of those structs: entry-wise
first, then by entry count. That matches map scalar equality, which is
already positional over entries, and Vortex maps enforce neither key
uniqueness nor key ordering, so there is no canonical entry order to
normalize to first.

- Route `DType::Map` through the row-wise nested comparator, comparing the
  entries list-view as values (its validity is the map's own validity, so
  `build_comparator` would re-test it per row).
- Implement `Scalar` ordering for maps so the constant-constant fold in
  `execute_compare` agrees with the array kernel.

Fixes #9297

Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Signed-off-by: Claude <noreply@anthropic.com>
@robert3005
robert3005 requested a review from AdamGS August 10, 2026 01:07
@robert3005 robert3005 added the changelog/fix A bug fix label Aug 10, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 10, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 6.56%

⚡ 1 improved benchmark
❌ 5 regressed benchmarks
✅ 1938 untouched benchmarks
⏩ 85 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation cold_misaligned[(64, 256)] 4.4 ms 5.2 ms -15.88%
Simulation take[small_m/shuffled/primitive/nonnull/chunks=1024/indices=1000] 5.6 ms 6.4 ms -13.18%
Simulation take[small_m/shuffled/primitive/nonnull/chunks=1024/indices=256] 2.1 ms 2.4 ms -13.07%
Simulation take[small_m/shuffled/primitive/nonnull/chunks=16384/indices=1000] 9.6 ms 10.8 ms -11.93%
Simulation decompress[u64, (1000, 16)] 65.1 µs 72.5 µs -10.26%
Simulation decompress[u32, (1000, 256)] 52.8 µs 39.8 µs +32.61%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/map-type-comparison-a7209a (a1a9670) with develop (7ec7ffb)2

Open in CodSpeed

Footnotes

  1. 85 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on develop (85926c4) during the generation of this report, so 7ec7ffb was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@robert3005
robert3005 merged commit e77f520 into develop Aug 10, 2026
93 of 95 checks passed
@robert3005
robert3005 deleted the claude/map-type-comparison-a7209a branch August 10, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants