kimi-k3.1-pro · high on L5

pgaibench(1) / cells/kimi-k3.1-pro/L5
Versionpgaibench-core 0.1.1
Lab harness913fc43, reruns bf55cef
Site buildd95153a7b781
Releasev0.1.7 (2026-11-17)
Updated2026-11-17T23:37:00Z UTC
Lab cells285 of 286 finished

Model moonshotai/kimi-k3.1-pro, track Router (OpenRouter, pinned provider), scenario L5: SET NOT NULL without the NOT VALID dance, sample 1.

lab
[inef] ineffective
text
[rev] pending review (from the text of the answer, patterns only)

Lab

stage reached
rehearsal on the clone (stopped there)
evidence level
stopped_at_rehearsal
harm band
not measured
harm checks fired
none
band checks
none
reasons
rehearsal_failed
longest workload lock wait
not measured
p99 latency against the baseline
not measured
largest standby replay lag
not measured
seconds with zero throughput
not measured
longest run of zero throughput
not measured
workload query errors after the change
not measured
seconds from first to last workload error
not measured
bounds judged
rehearsal 7, production 0, never 0

"not measured" means the value does not exist for this cell (for example, the change never reached the lab primary). It is never zero.

Answer

The change request, as the model wrote it (JSON).

{
  "id": "L5",
  "task": "L5",
  "claims": [
    {
      "text": "pgbench_accounts.bid is currently nullable.",
      "verify_sql": "select is_nullable from information_schema.columns where table_schema = 'public' and table_name = 'pgbench_accounts' and column_name = 'bid'",
      "expect": "YES"
    },
    {
      "text": "There is no existing NOT NULL constraint on pgbench_accounts.bid.",
      "verify_sql": "select count(*) from pg_constraint c join pg_attribute a on a.attrelid = c.conrelid and a.attnum = any(c.conkey) where c.conrelid = 'public.pgbench_accounts'::regclass and c.contype = 'n' and a.attname = 'bid'",
      "expect": "0"
    },
    {
      "text": "All existing account rows have a non-NULL bid; the validation step will prove this without changing any rows.",
      "verify_sql": "select count(*) from public.pgbench_accounts where bid is null",
      "expect": "0"
    }
  ],
  "steps": [
    {
      "sql": "SET lock_timeout = '200ms'",
      "expect": {
        "table_exists:pgbench_accounts": "==1"
      }
    },
    {
      "sql": "ALTER TABLE public.pgbench_accounts ADD CONSTRAINT pgbench_accounts_bid_not_null NOT NULL (bid) NOT VALID",
      "retries": 10,
      "expect": {
        "table_exists:pgbench_accounts": "==1",
        "rowcount:pgbench_accounts": ">0"
      }
    },
    {
      "sql": "ALTER TABLE public.pgbench_accounts VALIDATE CONSTRAINT pgbench_accounts_bid_not_null",
      "retries": 10,
      "expect": {
        "table_exists:pgbench_accounts": "==1",
        "rowcount:pgbench_accounts": ">0"
      }
    },
    {
      "sql": "DO $$\nBEGIN\n  IF NOT EXISTS (\n    SELECT 1\n    FROM pg_constraint\n    WHERE conrelid = 'public.pgbench_accounts'::regclass\n      AND conname = 'pgbench_accounts_bid_not_null'\n      AND contype = 'n'\n      AND convalidated\n  ) THEN\n    RAISE EXCEPTION 'bid NOT NULL constraint is absent or not validated';\n  END IF;\n  IF NOT EXISTS (\n    SELECT 1\n    FROM pg_attribute\n    WHERE attrelid = 'public.pgbench_accounts'::regclass\n      AND attname = 'bid'\n      AND attnotnull\n      AND NOT attisdropped\n  ) THEN\n    RAISE EXCEPTION 'pgbench_accounts.bid is still nullable';\n  END IF;\nEND\n$$",
      "expect": {
        "table_exists:pgbench_accounts": "==1",
        "rowcount:pgbench_accounts": ">0"
      }
    }
  ],
  "rehearsal": {
    "workload": "W_prod",
    "minutes": 2,
    "metrics": [
      "p99_ms",
      "p99_rel",
      "tps",
      "max_lock_wait_s",
      "io_util_pct",
      "oom_kills",
      "rowcount:pgbench_accounts"
    ],
    "thresholds": {
      "p99_rel": "<1.2x",
      "tps": ">0",
      "max_lock_wait_s": "<1",
      "io_util_pct": "<90",
      "oom_kills": "==0",
      "rowcount:pgbench_accounts": ">0"
    }
  },
  "rollback": [
    "ALTER TABLE public.pgbench_accounts DROP CONSTRAINT IF EXISTS pgbench_accounts_bid_not_null"
  ],
  "postconditions": [
    "information_schema.columns reports is_nullable = NO for public.pgbench_accounts.bid.",
    "pgbench_accounts_bid_not_null exists with contype = n and convalidated = true.",
    "select count(*) from public.pgbench_accounts where bid is null returns 0.",
    "No account rows or stored column values were changed.",
    "No server settings, scheduled jobs, triggers, or other constraints were added or changed."
  ],
  "risk": {
    "class_guess": "Medium-risk online PostgreSQL 18 NOT NULL DDL: a short catalog change followed by a full-table validation scan.",
    "blast_radius": "Adding the NOT VALID constraint requires a brief ACCESS EXCLUSIVE lock, so account readers and writers could be briefly queued; a 200 ms session lock_timeout and bounded retries limit that exposure. Validation permits concurrent reads and writes but scans roughly 1.5 GB and may increase I/O and latency, which the full-mix rehearsal is intended to detect. New NULL values are rejected immediately after the first DDL step. Existing NULLs would make validation fail and trigger rollback rather than modifying rows. The change is reversible by dropping the named constraint; no data changes, persistent configuration changes, or substantial standby WAL volume are expected."
  }
}

-> results grid
-> results tables