From f16ce970a55420c3def2be65dee1f57a3f5a8883 Mon Sep 17 00:00:00 2001 From: Davide Angelocola Date: Sun, 21 Jun 2026 15:21:25 +0200 Subject: [PATCH 1/2] test(cli): cover inspector per-chunk-stats pane via zone-mapped fixture Now that the writer emits vortex.stats zone-maps, the rich Java fixture's I64 column carries a per-chunk stats layout, so the inspector's per-chunk-stats detail pane (runStatsLoad / decodeStatsLayout / zoneStatsAnchor) renders and is asserted. Closes the coverage gap that first surfaced the missing writer capability. VortexInspectorTui line coverage 66.9% -> 75.8%, branch 55.5% -> 64.8%. Co-Authored-By: Claude Opus 4.8 --- .../dfa1/vortex/cli/tui/VortexInspectorTuiTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/src/test/java/io/github/dfa1/vortex/cli/tui/VortexInspectorTuiTest.java b/cli/src/test/java/io/github/dfa1/vortex/cli/tui/VortexInspectorTuiTest.java index 187f0e21..167778c2 100644 --- a/cli/src/test/java/io/github/dfa1/vortex/cli/tui/VortexInspectorTuiTest.java +++ b/cli/src/test/java/io/github/dfa1/vortex/cli/tui/VortexInspectorTuiTest.java @@ -72,10 +72,11 @@ void quitsOnEscapeWithoutRenderingDetails() throws Exception { } @Test - void deepExpand_rendersDictAndDataPanes_synchronously() throws Exception { - // Given — a rich fixture (low-cardinality dict column + an I64 column) and a - // script that expands the whole tree, then visits every row so each node's - // detail pane renders. worker == null runs all previews inline. + void deepExpand_rendersDictStatsAndDataPanes_synchronously() throws Exception { + // Given — a rich fixture (low-cardinality dict column + an I64 column, which the + // writer now wraps in a vortex.stats zone-map) and a script that expands the whole + // tree, then visits every row so each node's detail pane renders. worker == null + // runs all previews inline. Path file = TuiTestSupport.writeRichVortex(tmp, "rich.vortex", 200); FakeTerminal term = new FakeTerminal(new Terminal.Size(40, 120), expandAndVisitAll()); @@ -85,9 +86,10 @@ void deepExpand_rendersDictAndDataPanes_synchronously() throws Exception { VortexInspectorTui.run(term, tree, handle, null); } - // Then — the dictionary-preview and data-preview panes both rendered + // Then — the dictionary, per-chunk stats, and data preview panes all rendered String out = term.output(); assertThat(out).contains("Dictionary"); + assertThat(out).contains("Per-chunk stats"); assertThat(out).contains("Data (column"); } From dd46276718946c0e81c033bd4e0099ba5373f40a Mon Sep 17 00:00:00 2001 From: Davide Angelocola Date: Sun, 21 Jun 2026 15:25:02 +0200 Subject: [PATCH 2/2] test(integration): Rust reads Java-written vortex.stats zone-map Multi-chunk file written with enableZoneMaps (one zone per chunk) is read back via the Rust JNI reader; all values round-trip, proving the Java-emitted vortex.stats layout is Rust-compatible. Co-Authored-By: Claude Opus 4.8 --- .../JavaWritesRustReadsIntegrationTest.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/integration/src/test/java/io/github/dfa1/vortex/integration/JavaWritesRustReadsIntegrationTest.java b/integration/src/test/java/io/github/dfa1/vortex/integration/JavaWritesRustReadsIntegrationTest.java index 4a905776..0c140a5f 100644 --- a/integration/src/test/java/io/github/dfa1/vortex/integration/JavaWritesRustReadsIntegrationTest.java +++ b/integration/src/test/java/io/github/dfa1/vortex/integration/JavaWritesRustReadsIntegrationTest.java @@ -495,6 +495,37 @@ void javaWriter_jniReader_multipleChunks(@TempDir Path tmp) throws IOException { assertThat(decodedIds).containsExactly(1L, 2L, 3L, 4L, 5L); } + @Test + void javaWriter_jniReader_zoneMapped_multipleZones(@TempDir Path tmp) throws IOException { + // Given — a small chunkSize forces several chunks, so the writer emits a vortex.stats + // zone-map with one zone per chunk. The Rust reader must parse that layout and still + // return every value (zones are a transparent pruning aux). + Path file = tmp.resolve("java_zoned.vtx"); + WriteOptions zoneMapped = new WriteOptions(4, true, 0.90, 0, true, false); + long[] ids = new long[20]; + double[] vals = new double[20]; + for (int i = 0; i < 20; i++) { + ids[i] = i; + vals[i] = i * 0.5; + } + try (var ch = FileChannel.open(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE); + var sut = VortexWriter.create(ch, SCHEMA, zoneMapped)) { + for (int start = 0; start < 20; start += 4) { + sut.writeChunk(Map.of( + "id", Arrays.copyOfRange(ids, start, start + 4), + "value", Arrays.copyOfRange(vals, start, start + 4))); + } + } + + // When + long[] decodedIds = readLongColumn(file, "id"); + double[] decodedVals = readDoubleColumn(file, "value"); + + // Then — all rows survive the Java zone-map -> Rust read round-trip + assertThat(decodedIds).containsExactly(ids); + assertThat(decodedVals).containsExactly(vals); + } + @Test void javaWriter_jniReader_i32Column(@TempDir Path tmp) throws IOException { // Given