Marimo's print routing breaks Numba compilation In notebooks that do not use mo.Thread,…
- User
Marimo's print routing breaks Numba compilation
In notebooks that do not use
mo.Thread,printmust retain builtin identity so Numba can compile functions that call it.mo.Threadmust continue routing output to the spawning cell, with output isolation between concurrent threads.Interface
No new interfaces are introduced.
- Assistant
I’ll trace the print-routing implementation and its thread tests, then patch the narrowest layer that preserves builtin
printoutsidemo.Threadwhile keeping thread-local routing. - Assistant
rgisn’t installed in this checkout, so I’m using the repository’s available search tools and continuing with the same scope. - Assistant
The root cause is confirmed: every kernel injects a Python wrapper into the notebook globals before any thread exists, so
printis no longer the builtin that Numba recognizes. I’m moving that injection to the firstmo.Threadconstruction and adding kernel-level regression coverage for identity and concurrent routing. - Assistant
The targeted runtime tests now pass. The lazy installation preserves builtin identity until
mo.Thread()is actually used; once installed, routing remains per-thread because the wrapper still resolves each thread’s copied execution context and spawning cell ID. I’m doing the final type/diff checks now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- fable-5Compare side by side →
- fable-5Compare side by side →