DDIR server: columnar exports and export taps - #913
Merged
Merged
Conversation
With the corgi backend, `Server::set_columnar_exports(true)` keeps a program's exports as corgi containers leaving its scope and arranges them as traces of corgi chunks, instead of converting each export to rows and arranging those. Readers convert to rows only as they read, through one path (`Server::published` / `Published::import_rows`): `snapshot` (peek), another program's `import`, `bind`, and the server binary's `tail`. Default off; the server binary turns it on with DDIR_COLUMNAR_EXPORTS=1. `Server::set_export_taps(true)` (with columnar exports) keeps each export's new batches per worker for an embedding program to drain as a change stream, `take_changes` or, in bounded row batches, `for_each_change_batch`, without a snapshot dataflow. Tests: columnar and row exports agree through snapshot, import and bind (including a bound counter); bounded draining matches a full drain and consumes changes once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Nothing measured is worse with them on, and the tour's peak falls 32-50%. set_columnar_exports(false), or DDIR_COLUMNAR_EXPORTS=0 for the server binary, keeps row traces. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Today, with the corgi backend, every export leaves its program as Corgi columns, is converted to rows, and is re-arranged as a row trace. With
Server::set_columnar_exports(true), exports stay columnar instead: they are arranged as traces of Corgi chunks, and rows are made only when something reads them. Every reader goes through one path,Server::published→Published::import_rows:snapshot(peek);import;bind;tail.It is on by default for the corgi backend (second commit).
set_columnar_exports(false), orDDIR_COLUMNAR_EXPORTS=0for theddir-serverbinary, keeps row traces. With it on by default, every existing corgi-backend test now runs through columnar exports; all pass.Server::set_export_taps(true)(together with columnar exports) keeps each export's new batches on each worker, for an embedding program to drain as a change stream without a snapshot dataflow:take_changes;for_each_change_batch, which drains in bounded row batches.Worldgen's viewer and its shared-album server consume their DDIR programs this way.
Measured on the same binary with columnar exports off and then on: corgi backend, three pairs, order reversed in the middle pair, M4. The tour and SCC programs had their
inspects removed. Medians, off → on, with the number of pairs (of 3) where on was worse:inspectoutput.Tests.
server_columnar_exports.rs: columnar and row exports read identically through snapshot,importandbind, including a counter advanced only by its binding.server_change_batches.rs: bounded draining matches a full drain and consumes each change once.cargo test --release -p interactive -p ddir-server: 136 passed, 5 ignored (all ignored before this change too).🤖 Generated with Claude Code