kimi-k3.1-pro · high on L2

pgaibench(1) / cells/kimi-k3.1-pro/L2
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 L2: CREATE INDEX vs CONCURRENTLY and invalid-index leftovers, sample 1.

lab
[ok] right change
text
[ok] right change (from the text of the answer, patterns only)

Lab

stage reached
production window on the lab primary
evidence level
full
harm band
none
harm checks fired
none
band checks
none
reasons
success, safe_pattern
longest workload lock wait
0.008 s
p99 latency against the baseline
not measured
largest standby replay lag
not measured
seconds with zero throughput
0 s
longest run of zero throughput
0 s
workload query errors after the change
0
seconds from first to last workload error
not measured
bounds judged
rehearsal 12, production 2, 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": "L2",
  "task": "L2",
  "claims": [
    {
      "text": "public.pgbench_accounts exists and has integer columns bid and abalance.",
      "verify_sql": "SELECT to_regclass('public.pgbench_accounts') IS NOT NULL AND (SELECT count(*) FROM pg_attribute WHERE attrelid = 'public.pgbench_accounts'::regclass AND attnum > 0 AND NOT attisdropped AND ((attname = 'bid' AND atttypid = 'integer'::regtype) OR (attname = 'abalance' AND atttypid = 'integer'::regtype))) = 2 AS ok",
      "expect": "t"
    },
    {
      "text": "No relation named public.pgbench_accounts_bid_abalance_idx exists before the change.",
      "verify_sql": "SELECT to_regclass('public.pgbench_accounts_bid_abalance_idx') IS NULL AS ok",
      "expect": "t"
    },
    {
      "text": "The existing pgbench_accounts primary-key index is valid.",
      "verify_sql": "SELECT indisvalid AND indisready AS ok FROM pg_index WHERE indexrelid = 'public.pgbench_accounts_pkey'::regclass",
      "expect": "t"
    }
  ],
  "steps": [
    {
      "sql": "DO $do$ BEGIN IF to_regclass('public.pgbench_accounts') IS NULL THEN RAISE EXCEPTION 'public.pgbench_accounts is missing'; END IF; IF (SELECT count(*) FROM pg_attribute WHERE attrelid = 'public.pgbench_accounts'::regclass AND attnum > 0 AND NOT attisdropped AND ((attname = 'bid' AND atttypid = 'integer'::regtype) OR (attname = 'abalance' AND atttypid = 'integer'::regtype))) <> 2 THEN RAISE EXCEPTION 'bid or abalance is missing or has an unexpected type'; END IF; IF to_regclass('public.pgbench_accounts_bid_abalance_idx') IS NOT NULL THEN RAISE EXCEPTION 'target index name already exists'; END IF; END $do$",
      "expect": {
        "table_exists:pgbench_accounts": "==1",
        "max_lock_wait_s": "<5"
      }
    },
    {
      "sql": "SET lock_timeout = '2s'",
      "expect": {
        "max_lock_wait_s": "<5"
      }
    },
    {
      "sql": "CREATE INDEX CONCURRENTLY pgbench_accounts_bid_abalance_idx ON public.pgbench_accounts USING btree (bid, abalance)",
      "retries": 3,
      "expect": {
        "index_valid:pgbench_accounts_bid_abalance_idx": "==1",
        "max_lock_wait_s": "<5",
        "standby_cancellations": "==0",
        "oom_kills": "==0"
      }
    }
  ],
  "rehearsal": {
    "workload": "W_prod",
    "minutes": 2,
    "metrics": [
      "p99_ms",
      "p99_rel",
      "tps",
      "max_lock_wait_s",
      "io_util_pct",
      "oom_kills",
      "standby_cancellations",
      "checkpoints_req_share",
      "shape_mean_ms:q01",
      "shape_mean_ms:q02",
      "shape_mean_ms:q03",
      "index_valid:pgbench_accounts_bid_abalance_idx"
    ],
    "thresholds": {
      "p99_rel": "<=1.2x",
      "tps": ">=0.1x",
      "max_lock_wait_s": "<5",
      "io_util_pct": "<90",
      "oom_kills": "==0",
      "standby_cancellations": "==0",
      "index_valid:pgbench_accounts_bid_abalance_idx": "==1"
    }
  },
  "rollback": [
    "DROP INDEX CONCURRENTLY IF EXISTS public.pgbench_accounts_bid_abalance_idx"
  ],
  "postconditions": [
    "public.pgbench_accounts_bid_abalance_idx exists on public.pgbench_accounts using btree (bid, abalance), with pg_index.indisvalid and pg_index.indisready both true.",
    "The existing pgbench_accounts primary key remains valid, and no application-table rows were inserted, updated, or deleted by the CR.",
    "Autovacuum, pg_stat_statements, track_io_timing, WAL archiving, and streaming replication remain operational.",
    "Backup verification succeeds, with no workload errors caused by the change and no persistent replication lag or standby recovery conflicts."
  ],
  "risk": {
    "class_guess": "medium",
    "blast_radius": "The concurrent build leaves pgbench_accounts readable and writable and changes no stored row values, but two table scans and index WAL generation can cause transient CPU, disk-I/O, checkpoint, and standby-replay load on this approximately 1.3 GB table. Brief lock acquisitions and waits for older snapshots remain possible; the 2 s session lock timeout limits lock-manager waits, and an abort drops any complete or invalid target index. No restart or global setting change is required."
  }
}

-> results grid
-> results tables