Skip to content

Fix wasm32 build by gating MultiFileSession on non-wasm targets#8612

Merged
robert3005 merged 2 commits into
developfrom
claude/wasm-time-panic-c9b6s6
Jun 27, 2026
Merged

Fix wasm32 build by gating MultiFileSession on non-wasm targets#8612
robert3005 merged 2 commits into
developfrom
claude/wasm-time-panic-c9b6s6

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

Rationale for this change

The MultiFileSession holds a moka cache that reads std::time::Instant::now() during construction. The Instant type is unsupported on wasm32 targets and panics with "time not implemented on this platform". Since multi-file scanning is not available on wasm anyway, this change gates the MultiFileSession registration behind a #[cfg(not(target_arch = "wasm32"))] guard to allow the wasm32 build to succeed.

What changes are included in this PR?

Added a #[cfg(not(target_arch = "wasm32"))] attribute to the MultiFileSession registration in vortex/src/lib.rs to prevent instantiation of the session on wasm32 targets where std::time::Instant is not available.

What APIs are changed? Are there any user-facing changes?

No public APIs are changed. This is a build fix that prevents a panic on wasm32 targets. Multi-file scanning functionality remains unavailable on wasm, as it was before.

https://claude.ai/code/session_01P5VUBo8DhakxhhF1Ux2Kte

@robert3005 robert3005 requested a review from a team June 27, 2026 15:36
…t panic

`VortexSession::default()` eagerly constructs every registered session
variable. With the `files` feature enabled (as in vortex-web), that
includes `MultiFileSession`, whose `moka` cache builds a `Clock` that
calls `std::time::Instant::now()` on construction. `Instant` is
unsupported on `wasm32` and panics with "time not implemented on this
platform", so vortex-web panicked the first time its session was created
— which happens on file import.

Multi-file scanning is not available on wasm, so only register
`MultiFileSession` on non-wasm targets.

Verified by building `vortex-web-wasm` for `wasm32-unknown-unknown`
(release): the "time not implemented on this platform" panic path is
present before this change and gone afterwards.

Signed-off-by: Robert <robert@spiraldb.com>
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 force-pushed the claude/wasm-time-panic-c9b6s6 branch from 3356f9a to ff24840 Compare June 27, 2026 15:37
@robert3005 robert3005 added the changelog/fix A bug fix label Jun 27, 2026
@codspeed-hq

codspeed-hq Bot commented Jun 27, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 11.1%

⚠️ 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.

⚡ 1 improved benchmark
✅ 1594 untouched benchmarks
⏩ 4 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation encode_varbin[(1000, 8)] 156.9 µs 141.2 µs +11.1%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/wasm-time-panic-c9b6s6 (87f538a) with develop (88222ac)

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.

@robert3005 robert3005 enabled auto-merge (squash) June 27, 2026 15:57
Comment thread vortex/src/lib.rs Outdated
@lwwmanning lwwmanning disabled auto-merge June 27, 2026 17:50

@lwwmanning lwwmanning left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving but I disabled auto-merge, up to you whether you want to address my nit

Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 enabled auto-merge (squash) June 27, 2026 18:59
@robert3005 robert3005 merged commit bf2be52 into develop Jun 27, 2026
69 checks passed
@robert3005 robert3005 deleted the claude/wasm-time-panic-c9b6s6 branch June 27, 2026 19:06
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