Skip to content

Back VortexSession with ArcSwap for mutable but less errorprone session management#8631

Merged
robert3005 merged 5 commits into
developfrom
claude/cool-mendel-iclftk
Jul 1, 2026
Merged

Back VortexSession with ArcSwap for mutable but less errorprone session management#8631
robert3005 merged 5 commits into
developfrom
claude/cool-mendel-iclftk

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

I think immutable session is nice but hard to integrate it with for a lot of
systems

Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 requested a review from a team June 30, 2026 16:40
@codspeed-hq

codspeed-hq Bot commented Jun 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 6 improved benchmarks
❌ 7 regressed benchmarks
✅ 1582 untouched benchmarks
⏩ 4 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_bool_canonical_into[(1000, 10)] 15.9 µs 26.6 µs -40.26%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 168.9 µs 205.5 µs -17.77%
Simulation search_index_below_min_chunked 1.3 ms 1.6 ms -16.68%
Simulation search_index_mixed_out_of_range_chunked 1.3 ms 1.6 ms -16.59%
Simulation search_index_full_range_random_chunked 1.4 ms 1.6 ms -16.26%
Simulation search_index_above_max_chunked 1.7 ms 2 ms -14.63%
Simulation search_index_in_range_chunked 1.9 ms 2.2 ms -13.61%
Simulation encode_varbin[(1000, 8)] 159.9 µs 140.1 µs +14.1%
Simulation encode_varbin[(1000, 2)] 157.4 µs 138.7 µs +13.47%
Simulation chunked_varbinview_into_canonical[(100, 100)] 306.6 µs 271.6 µs +12.89%
Simulation bitwise_not_vortex_buffer_mut[128] 273.6 ns 244.4 ns +11.93%
Simulation compact_sliced[(4096, 90)] 895.8 ns 808.3 ns +10.82%
Simulation chunked_varbinview_opt_into_canonical[(100, 100)] 388.9 µs 353.2 µs +10.11%

Tip

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


Comparing claude/cool-mendel-iclftk (83cc11b) with develop (3e7098c)

Open in CodSpeed

Footnotes

  1. 4 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.

Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 requested a review from AdamGS June 30, 2026 17:02
Signed-off-by: Robert Kruszewski <github@robertk.io>
@gatesn

gatesn commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Ok.... so instead of deadlocks we now have a footgun for getting stale data? Why have a mutable session if you make it easy to snapshot state out of the session that will never reflect mutability?

Comment thread vortex-session/src/session.rs Outdated
claude and others added 2 commits June 30, 2026 19:39
…lding a guard

Adds coverage for the case where a `SessionGuard` is held while the session is
written through. A guard is a lock-free arc-swap snapshot, not a lock, so writes
never wait on outstanding guards:

- `inserting_a_default_while_holding_a_guard_succeeds`: holds a guard for one
  variable, then reads a *missing* variable (which inserts its default
  copy-on-write via `rcu`) while the first guard is still alive. The insert
  completes instead of deadlocking, and both the held and freshly read guards
  are usable.
- `a_held_guard_keeps_observing_its_own_snapshot_after_a_write`: a held guard
  keeps observing the snapshot it was read from (arc-swap keeps that snapshot
  alive for the guard's lifetime) while a fresh read sees the newly published
  value.

Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ncJ2VLHwbpsM1hMMBpXGP
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005

Copy link
Copy Markdown
Contributor Author

I don't understand what you're referring to? Can you maybe write a test to demonstrate?

@robert3005 robert3005 added the changelog/chore A trivial change label Jul 1, 2026
@robert3005 robert3005 merged commit c7e8ae9 into develop Jul 1, 2026
83 of 85 checks passed
@robert3005 robert3005 deleted the claude/cool-mendel-iclftk branch July 1, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants