Documentation
¶
Overview ¶
Package optswitch is the registry of optimization kill switches (#287).
Every optimization that can change the shape of query results — pruning, pushdown, plan rewrites, fast-path operator variants — registers a Toggle here, named and bound to its env kill switch. Production behavior is unchanged: a toggle is on unless its env var is "0", exactly the convention the ad-hoc `os.Getenv(...) != "0"` vars used.
The registry exists so the optimization-invariance oracle (internal/oracle) can enumerate every switch and run each corpus query with optimizations individually disabled, asserting identical results. Adding a kill switch for new optimization work is part of its definition of done — registering it here extends the oracle for free.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Toggle ¶
type Toggle struct {
Name string // short stable id, e.g. "scan-filter"
Env string // kill-switch env var, e.g. WADJET_SCAN_FILTER
Desc string // one-line description of what turning it off disables
// contains filtered or unexported fields
}
Toggle is one registered optimization switch. On() is safe for concurrent readers and cheap enough for per-query (not per-row) checks.
func All ¶
func All() []*Toggle
All returns every registered toggle, sorted by name. Only toggles whose defining packages are linked into the binary appear.