OxL Reference

error ab-test-decl

error Standard: [§18.5]

What it means#

test ab "name" { … } declares an A/B experiment (§18.5): its body is a list of clauses, checked by the compiler (D-6850..D-6855):

  • exactly two variant name = f clauses, the control first (an experiment is a dynamic Flag, which is on or off — D-6852); f must name something of the program;
  • split by .User|.Tenant|.Node a/b with one share per variant, adding up to 100 (a Flag splits by these dimensions only, §14.2);
  • every metric / guard metric is built in (latency.p50, latency.p95, latency.p99, latency.mean, error_rate) or the name of a std.obs metric (no dots);
  • traffic recorded("file.oxlrec") names the recorded traffic (relative to the package root, D-6853).

Example#

oxl✓ checked in CI
fn oldSearch(q: str) -> str pure => q
fn newSearch(q: str) -> str pure => q
fn otherSearch(q: str) -> str pure => q

test ab "search v2" {
  variant a = oldSearch
  variant b = newSearch
  variant c = otherSearch          // <- ab-test-decl: exactly two variants
  split by .Request 40/30/30       // <- ab-test-decl: a Flag splits by .User, .Tenant or .Node
  metric latency.p42               // <- ab-test-decl: unknown metric
}                                  // <- ab-test-decl: no `traffic recorded(...)`
error
ab-test-decl

How to fix#

oxl✓ checked in CI
test ab "search v2" {
  variant a = oldSearch
  variant b = newSearch
  split by .User 50/50
  metric ctr, latency.p95
  guard latency.p95 < SEARCH_P95_LIMIT
  traffic recorded("traffic/search.oxlrec")
}

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides