Jane Street logo

Jane Street

OCaml and Systems rolled into one

Try:
Jane Street logo
Jane Street

What the interns have wrought, 2025 edition

Jane Street internship recap highlighting three detailed projects: an index-aware JSQL evaluator that yields large query speedups, new OxCaml-based ocamltorch APIs for deterministic tensor refcount scopes to reduce GPU/GC overhead, and a ref-counted shared-memory object library to avoid serialization between processes. The post also summarizes several other intern projects (LSP/CSS validator, quickcheck-like testing, JIT for HardCaml, predicate pushdown, etc.).

Jane Street logo
Jane Street

A Higgs-bugson in the Linux Kernel

An intermittent -EACCES during large NFSv3 (Kerberos-protected) file copies was root-caused to a GSS sequence-number vs XID interleaving: retransmitted requests reused the XID but had a new GSS sequence number, so late responses tied to the old sequence number failed HMAC verification. The author reproduced the bug using an in-memory FUSE filesystem (rust + fuser), instrumented the kernel with eBPF/bpftrace, wrote a Wireshark plugin to recompute GSS HMACs, used NFQUEUE to delay packets, and implemented two kernel patches (a sequence-number cache per RFC2203 and not immediately retransmitting on bad checksum). Patches were upstreamed to Linux and will appear in 6.16.

Jane Street logo
Jane Street

Introducing OxCaml

The post describes OxCaml, a branch of the OCaml compiler that adds extensions aimed at performance engineering. Key extensions discussed include static, type-system based concurrency checks, explicit memory layouts with SIMD access, and tools for controlling allocation to reduce GC pressure. It also lists language-level quality-of-life features such as polymorphic parameters, include functor, labeled tuples, and immutable arrays. OxCaml builds on the Flambda2 middle-end to enable optimizer-driven features and ships with modified tooling (dune/opam-compatible package management, LSP, and a formatter). The post notes OxCaml remains backwards compatible with OCaml but marks its extensions as experimental and not guaranteed stable.

Jane Street logo
Jane Street

Advent of Hardcaml

The post describes implementing Advent of Code puzzles on an FPGA using Hardcaml, an OCaml-embedded HDL, targeting a Lattice ECP5 with the Yosys + NextPNR toolchain. It shows how OCaml’s types and higher-order functions enable reusable sliding-window circuits for pattern matching and deeply pipelined brute-force evaluators that achieve one attempt per cycle, all within a modular interface shared between simulation and hardware.

Jane Street logo
Jane Street

How we accidentally built a better build system for OCaml

Jane Street recounts the evolution of their OCaml build tooling: they built Jenga, released a compatibility shim jbuilder that became Dune, and ultimately migrated their 70M-line OCaml monorepo from Jenga to Dune. The move focused on performance (large end-user speedups and better cached builds), cross-platform support, editor integrations, and upstreaming scale optimizations.

Jane Street logo
Jane Street

Developer education at Jane Street

Jane Street describes their developer education program: an OCaml Bootcamp plus multi-day Dev Teach-ins covering testing (expect tests, Quickcheck, Datafetcher), marketdata, advanced functional programming (GADTs, finger trees, automatic differentiation), OCaml performance tooling (perf, memtrace, magic-trace), frontend development with their Bonsai framework (inspired by React/Elm), and systems debugging (Linux, strace, gdb). The post emphasizes education as core engineering culture and the firm’s investment in dev educators and classroom space.

Jane Street logo
Jane Street

ICFP 2024

Jane Street describes technical work on extending the OCaml compiler with modal types, modes (e.g. local and unique), and a kind system to enable unboxed memory layouts and more control over allocation. They discuss implementing mixed blocks to represent structures with mixed layouts, and a zero-overhead nullable option representation using kinds to prevent unsafe nesting. The post explains Bonsai’s two-phase frontend model (a graph-building phase producing a DAG and a runtime phase where data flows through that graph) and how that enables sharing and incremental performance optimizations. It also covers limits in polymorphism at the kind and mode level and their ppx_template tool to generate code for multiple kinds and modes. Finally, they mention a bleeding-edge opam repository and conference demos to let users try the compiler branch and libraries.

Jane Street logo
Jane Street

What the interns have wrought, 2024 edition

Jane Street's 2024 intern roundup describes three projects: Camels, an OCaml-native dataframe library designed with an expression AST and type-tracking to enable future parallel/SIMD backends; a new fast-but-larger binary serializer for OCaml that leverages typerep and memcpy-friendly layouts to significantly reduce tail latencies; and a time-travel debugger for Limshare (an Aria-based system) that uses snapshots to make replay-based debugging fast and practical in production.

Jane Street logo
Jane Street

Visualizing piecewise linear neural networks

The post visualizes piecewise-linear (ReLU-style) neural networks by computing and showing the polyhedral complex of linear regions induced by activation patterns, explains an algorithm to enumerate feasible regions per layer, and demonstrates how these regions evolve as network weights are trained. It uses LeakyReLU(0.02) in the visualized networks.

Jane Street logo
Jane Street

What the interns have wrought, 2023 edition

Jane Street summarizes three notable 2023 intern projects: (1) a SQL-like temporal query language frontend to an LTL-based stream-query engine for Concord (parser built with Angstrom on OCaml) to make log/transaction sequence queries easier; (2) a pure-OCaml tokenizer implementation (to replace a tiktoken/python HTTP server) that matches/reference-tests against Python and Rust implementations and achieves competitive performance after profiling and algorithmic changes; and (3) async-aware tracing improvements to ppx_tracing (OCaml PPX) that integrate with the Async scheduler, emit correlation IDs, and update Fuchsia/Perfetto trace tooling so traces work correctly with asynchronous code. The projects improved debugging, observability and performance and have seen adoption internally.

Jane Street logo
Jane Street

Oxidizing OCaml: Data Race Freedom

A technical design post describing Jane Street extensions to OCaml (for OCaml 5 / multicore OCaml) that introduce modes (locality, uniqueness, linearity, sync, once) and capsules to make shared-memory parallel code statically data-race-free. The article explains sync/unsync modes, exclusive mutability, mutexes, capsules/keys/pointers, and shows how to build locked data structures (e.g., a locked hashtable), with notes on runtime implementation and performance.

Jane Street logo
Jane Street

Oxidizing OCaml: Rust-Style Ownership

Technical explanation of adding Rust-style ownership and linearity modes to OCaml (uniqueness, exclusive/shared, borrowing, once/many/separate), how these modes enable in-place updates and safer APIs, and how they can help prevent data races in multicore OCaml; includes comparisons with Rust and notes on implementation work by Jane Street's compilers team.

Jane Street logo
Jane Street

Oxidizing OCaml: Locality

Jane Street describes adding a system of "modes" to OCaml to track locality (local vs global) so the compiler can safely emit stack-allocated values, reduce heap allocations, and enable safer resource-management APIs. The post explains local variables, local-returning functions (exclave), deepness and sub-modes, interactions with types and inference, and production usage; it contrasts the approach with Rust lifetimes and notes plans to add ownership-like modes for uniqueness and linearity in a follow-up.

Jane Street logo
Jane Street

Building reproducible Python environments with XARs

Jane Street describes how they built reproducible, centrally-built Python environments using XAR single-file archives (squashfs + zstd) and an internal tool (js-python). They moved away from shared Conda environments on NFS, integrated OCaml bindings by statically bundling them into environments, and adopted CI-driven builds with versioned nightly/stable tags to improve reproducibility and startup performance, while noting trade-offs around hotfix agility.

Jane Street logo
Jane Street

What if writing tests was a joyful experience?

A Jane Street engineer describes the expect‑tests (snapshot) testing pattern and workflow, showing how blank expect blocks and editor integration make writing exploratory and regression‑guarding tests fast and pleasant. The article includes examples across OCaml tooling: Bonsai UI tests, magic‑trace system traces, state‑machine/order‑book tests, and Hardcaml FPGA waveforms, and contrasts expect tests with traditional unit/assertion testing.

Jane Street logo
Jane Street

Accelerating zk-SNARKs - MSM and NTT algorithms on FPGAs with Hardcaml

Jane Street used Hardcaml to implement FPGA-accelerated MSM and NTT kernels for zk-SNARK prover workloads. They optimized Pippenger (MSM) and a 4-step Cooley-Tukey-based NTT for Xilinx FPGA cards, measured latency/power/resource usage on AWS f1.2xlarge and a C1100 Varium card, and placed first in the ZPrize MSM track and second in the NTT track.

Jane Street logo
Jane Street

Visualizing information propagation in markets

Jane Street visualized how information about price moves propagates between global equity-index futures by detecting high-frequency price moves (>0.01% in 5 ms), correlating sequential events across exchanges during a Fed announcement, and mapping them on a globe with rings representing speed-of-light and half-speed-of-light propagation.

Jane Street logo
Jane Street

Computations that differentiate, debug, and document themselves

Jane Street presents Gradient_calculator, an OCaml library that models computations as expression trees and provides forward-mode automatic differentiation, evaluation, debugging (debug trees + expect-tests), auto-generated LaTeX documentation, and a gradient-descent optimizer. The post explains API design, implementation choices (forward-mode AD, trade-offs vs. reverse-mode), real-world examples (net market value calculation), and possible future work such as incremental evaluation, compiler-style optimizations, and use of algebraic effects in OCaml 5.0. The project is planned to be open-sourced.