Use marimo export session for session snapshots (and make embedding notebook GPU friendly)#63
Merged
Conversation
The session scripts reached into marimo internals to run notebooks and serialize snapshots, but internals changed recently. `create-sessions.py` is now a thin wrapper around `marimo export session --sandbox`. The embeddings notebook is regenerated under the new tooling, which also folds in moving the computed embedding to CPU before plotting and a `tight_layout` call to make the full figure render.
There was a problem hiding this comment.
Pull request overview
This PR updates session snapshot tooling to use the supported marimo export session command and refreshes the embeddings notebook for newer marimo output/GPU-friendly plotting.
Changes:
- Replaces custom session execution/serialization logic with a thin CLI wrapper around
marimo export session --sandbox. - Updates session validation to compute freshness using marimo’s current session-cache hash helper.
- Regenerates the embeddings notebook metadata and moves embeddings to CPU before plotting.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/validate-sessions.py |
Updates notebook discovery and session freshness hashing for newer marimo session exports. |
scripts/create-sessions.py |
Simplifies snapshot generation by delegating to marimo export session --sandbox. |
scripts/create-sessions-changed.sh |
Narrows changed-file discovery to notebook paths before regenerating sessions in parallel. |
notebooks/algorithms/visualizing-embeddings.py |
Updates marimo generation metadata and adjusts plotting for CPU/tight layout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The session scripts reached into marimo internals to run notebooks and serialize snapshots, but internals changed recently. So,
create-sessions.pyis now a thin wrapper aroundmarimo export session --sandbox.The embeddings notebook is regenerated under the new tooling, which also folds in moving the computed embedding to CPU before plotting and a
tight_layoutcall to make the full figure render.