Field noteDec 2, 20263 min read1 source

TreeWalker: Avoiding redundant work across rows and trees

In one minute

Shopify built TreeWalker, an open-source Rust inference engine for tree ensembles, and measured it scoring the company’s delivery model 3.96× faster than its current evaluator, with the same training, trees and results. (shopify.engineering)

What changed: Shopify introduced TreeWalker, an open-source Rust inference engine that reportedly scored its delivery model nearly four times faster than its current evaluator.

What happened

Shopify’s delivery system uses a discrete-time hazard model to estimate the conditional probability that a package arrives on each future date. (shopify.engineering) A forecast scores related rows through the same tree ensemble: shipment features stay fixed while horizon and calendar features vary. (shopify.engineering) At checkout, the system must forecast delivery dates for multiple shipping methods under a small latency budget. (shopify.engineering)

TreeWalker groups rows whose constant features the group’s producer guarantees are equal. (shopify.engineering) It shares decisions on those fixed features and prepares answers for repeated tests on varying features so they can be reused across trees. (shopify.engineering) At model load, it identifies repeated predicates and matching prefixes. (shopify.engineering) For each input group, it sorts values once per varying numeric feature and sweeps distinct thresholds to build reusable predicate masks. (shopify.engineering) Row masks track active subsets with one bit per row; traversal can skip an empty sibling branch when all rows in a subset take the same branch, an optimization Shopify calls the unsplit shortcut. (shopify.engineering) Grouped traversal keeps the learned tests and leaf contributions unchanged. Compact nodes and a preferred child placed next to its parent improve locality and let traversal continue along that path in a loop. (shopify.engineering)

Separately from the internal delivery-model measurement, Shopify’s published paper evaluates the public survival datasets SUPPORT and FLCHAIN. (shopify.engineering)

In Shopify’s internal measurement, TreeWalker scored its delivery model 3.96× faster than the current delivery evaluator, with training, trees and results unchanged. (shopify.engineering)

Why it matters

A promising fit is batch scoring where rows share features that the caller can guarantee are constant, such as forecasts that vary by horizon while retaining shipment attributes. The potential gain depends on group size: sorting and preparing reusable masks can cost more than they save.

Limits and uncertainty

The 3.96× figure is Shopify’s internal comparison, not a general benchmark. Preparation has sorting, threshold-sweeping and mask-storage costs, especially for small groups; wider groups need more mask words, and leaf contributions still have to be added to each active row. (shopify.engineering) Shopify also says a naive implementation that copies row lists at each decision point would be slower than plain LightGBM. (shopify.engineering) The available description does not include the paper’s complete evaluation or results.

Reader takeaway

TreeWalker’s result is a workload-specific case for grouped tree inference: when rows share guaranteed-constant features, decision work can be reused without retraining. Shopify measured a 3.96× speedup on its delivery model, but sorting, mask storage and per-row output updates mean the approach is not automatically faster for small groups or every model.

Open question

How does the speedup vary with group size and model characteristics across the full SUPPORT and FLCHAIN evaluation?

How this was made

First seen
Dec 2, 2026, 19:00 UTC in our intake.
Sources
1 source carried the story when we picked it up; we cite the original.
Written by
gpt-6-luna (AI model).
Critic
No separate critic model on this desk; the automated checks below gate publication.
Checks passed
The cited primary source was fetched and verified; the source is not older than 30 days; no earlier note covers the same story; the copy passed the site's structure and language checks.
Confidence
Novelty judgement: a new fact, high confidence. Editorial value: high.
Human review
Published without a per-item human sign-off. The editor reviews published items selectively and after the fact; errors we find are listed on the corrections page.

Corrections and error statistics

Evidence / sources

  1. 1shopify.engineering/treewalker
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicInferenceExplore the inference topic hub.
  2. 02archiveField NotesOpen the latest editorial analysis.
  3. 03sourcesSourcesSee the original sources this archive cites.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract