Chalk's static accelerator translates Python resolver functions into native
columnar expressions via symbolic execution of the function's bytecode.
Accelerated resolvers run orders of magnitude faster than interpreted Python.
A resolver can only be accelerated when every operation it performs can be
proven safe and is supported by the accelerator.
This skill drives a feedback loop against the Chalk static accelerator
service: get diagnostics, rewrite the offending resolvers, repeat until clean.
-
From anywhere inside the Chalk project (the directory tree containing
or
), run:
sh
python "${CLAUDE_PLUGIN_ROOT}/bin/accelerator-diagnostics.py"
Use the same Python environment the project uses (it must be able to
). If the project uses a venv, activate it first or invoke
the venv's
explicitly.
-
Read the diagnostics. Each line is
file:line: severity: message
and the
message explains exactly which operation blocked acceleration, e.g.:
'int.__add__(int)' is only supported for non-null values; guard this 'option<int>' argument against None
— a nullable input (annotated
/ on the feature class) flows into an
operation that requires a non-null value.
reference to possibly-unbound name 'uuid'
— the resolver uses an
import or helper the accelerator cannot capture (an unsupported
library), or a local variable that is not assigned on every path.
-
Rewrite the resolver to remove the failure point (see recipes below).
Preserve the resolver's signature, output feature, and Python semantics —
the accelerated version must compute the same values the Python version
would.
-
Re-run the script. Repeat until it prints
All resolvers are statically accelerable.
and exits 0.
The most common diagnostic. A feature annotated
may be None at
runtime; operations like
,
,
, comparisons, and most method calls
require proven-non-null operands. Add an explicit guard so the symbolic
executor can narrow the type:
Both
if a is None: return <default>
early-returns and
x = 0 if a is None else a
conditional expressions work. If no sensible
default exists, ask the user what the None case should produce — do not
invent business logic silently.
The accelerator supports a fixed set of builtins and modules (including
,
,
,
,
,
, common
/
/
/
methods,
,
, and protobuf message
access). A reference to anything else (e.g.
,
-adjacent
helpers, custom classes) fails with a "possibly-unbound name" or
"Unsupported" diagnostic.
If a variable is only assigned inside a conditional or loop, assign a default
before the conditional so every path binds it.