{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.ents-iterator.v1","fixtureId":"gmod.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"3990c92253db85bb","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4461,"startedAt":"2026-07-10T17:24:54.312Z","completedAt":"2026-07-10T17:24:58.781Z","answerBytes":268,"answerChars":268,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":72,"completionTokens":67,"totalTokens":139,"source":"estimated"},"finalResponse":"```lua\nfor _, ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- use ent here\n    end\nend\n```\nReason: `ents.Iterator()` streams entities one by one, so it avoids allocating a full table like `ents.GetAll()` or `ents.FindByClass()` first.","model_patch":"```lua\nfor _, ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- use ent here\n    end\nend\n```\nReason: `ents.Iterator()` streams entities one by one, so it avoids allocating a full table like `ents.GetAll()` or `ents.FindByClass()` first."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.hook-add.v1","fixtureId":"gmod.hook-add.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"12d2222fdb7d6b90","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Registers a named hook with hook.Add.","durationMs":4607,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:24:58.935Z","answerBytes":214,"answerChars":214,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":78,"completionTokens":54,"totalTokens":132,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- Per-frame logic here.\nend)\n```\nReason: `hook.Add` registers a callback on the `Think` hook, and `MyAddon.Think` is the unique identifier for this handler.","model_patch":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- Per-frame logic here.\nend)\n```\nReason: `hook.Add` registers a callback on the `Think` hook, and `MyAddon.Think` is the unique identifier for this handler."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.isvalid.v1","fixtureId":"gmod.isvalid.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"35527312e59dfc13","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Uses IsValid for entity/object validity.","durationMs":5953,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:00.277Z","answerBytes":184,"answerChars":184,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":74,"completionTokens":46,"totalTokens":120,"source":"estimated"},"finalResponse":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: `IsValid(ent)` is the standard Garry's Mod check that the entity reference still exists and is safe to call methods on.","model_patch":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: `IsValid(ent)` is the standard Garry's Mod check that the entity reference still exists and is safe to call methods on."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.net-receivers.v1","fixtureId":"gmod.net-receivers.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"24d54ee8366753a6","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5439,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:24:59.786Z","answerBytes":263,"answerChars":263,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":64,"completionTokens":66,"totalTokens":130,"source":"estimated"},"finalResponse":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle the incoming message here\nend)\n```\nReason: `net.Receive` registers a callback for the named incoming net message, and the handler receives the message length and the sending player on the server.","model_patch":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle the incoming message here\nend)\n```\nReason: `net.Receive` registers a callback for the named incoming net message, and the handler receives the message length and the sending player on the server."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.angle-zero.v1","fixtureId":"gmod.perf.angle-zero.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f6bc97bf98280d62","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":6140,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:00.506Z","answerBytes":239,"answerChars":239,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":60,"totalTokens":131,"source":"estimated"},"finalResponse":"```lua\nlocal ANGLE_ZERO = Angle(0, 0, 0)\n\n-- Hot path\nsomeEntity:SetAngles(ANGLE_ZERO)\n```\nReason: Reusing one shared zero `Angle` avoids repeated object construction and garbage pressure from calling `Angle()` on every hot-path iteration.","model_patch":"```lua\nlocal ANGLE_ZERO = Angle(0, 0, 0)\n\n-- Hot path\nsomeEntity:SetAngles(ANGLE_ZERO)\n```\nReason: Reusing one shared zero `Angle` avoids repeated object construction and garbage pressure from calling `Angle()` on every hot-path iteration."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.config-var.v1","fixtureId":"gmod.perf.config-var.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"bcc4ff8eb162b699","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5826,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:00.260Z","answerBytes":223,"answerChars":223,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":82,"completionTokens":56,"totalTokens":138,"source":"estimated"},"finalResponse":"```lua\nlocal MYADDON_COLOR = \"blue\"\nlocal color = MYADDON_COLOR\n```\nReason: A flat local is fastest for frequent reads because Lua resolves locals more cheaply than repeated table field lookups like `myaddon.config.color`. ","model_patch":"```lua\nlocal MYADDON_COLOR = \"blue\"\nlocal color = MYADDON_COLOR\n```\nReason: A flat local is fastest for frequent reads because Lua resolves locals more cheaply than repeated table field lookups like `myaddon.config.color`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.darkrpvar.v1","fixtureId":"gmod.perf.darkrpvar.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"02a37daa699cded3","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6285,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:00.667Z","answerBytes":242,"answerChars":242,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":61,"totalTokens":127,"source":"estimated"},"finalResponse":"```lua\nlocal preferred = ply:getDarkRPVar(\"job\")\nlocal old = ply:GetNWString(\"job\")\n```\nReason: `ply:getDarkRPVar(\"job\")` is the DarkRP-supported API for job names; `GetNWString(\"job\")` is older, less direct, and can desync from DarkRP state.","model_patch":"```lua\nlocal preferred = ply:getDarkRPVar(\"job\")\nlocal old = ply:GetNWString(\"job\")\n```\nReason: `ply:getDarkRPVar(\"job\")` is the DarkRP-supported API for job names; `GetNWString(\"job\")` is older, less direct, and can desync from DarkRP state."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.disttosqr.v1","fixtureId":"gmod.perf.disttosqr.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a5772470c6859cdc","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6008,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:00.385Z","answerBytes":221,"answerChars":221,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":56,"totalTokens":127,"source":"estimated"},"finalResponse":"```lua\nif pos1:DistToSqr(pos2) <= maxDistance * maxDistance then\n    -- within range\nend\n```\nReason: `Vector:DistToSqr` avoids the square root in `Distance`, so it is the preferred faster method for threshold comparisons.","model_patch":"```lua\nif pos1:DistToSqr(pos2) <= maxDistance * maxDistance then\n    -- within range\nend\n```\nReason: `Vector:DistToSqr` avoids the square root in `Distance`, so it is the preferred faster method for threshold comparisons."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ents-iterator.v1","fixtureId":"gmod.perf.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"306d3f1d05f28246","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6344,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:00.716Z","answerBytes":238,"answerChars":238,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":60,"totalTokens":126,"source":"estimated"},"finalResponse":"```lua\nfor ent in ents.Iterator() do\n    -- use ent\nend\n```\nReason: `ents.Iterator()` avoids building the table returned by `ents.GetAll()`, so it is the efficient wiki-recommended choice when you only need to visit each live entity once.","model_patch":"```lua\nfor ent in ents.Iterator() do\n    -- use ent\nend\n```\nReason: `ents.Iterator()` avoids building the table returned by `ents.GetAll()`, so it is the efficient wiki-recommended choice when you only need to visit each live entity once."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-ents-near.v1","fixtureId":"gmod.perf.find-ents-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"07c583fc3d9fe09f","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":5345,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:24:59.687Z","answerBytes":204,"answerChars":204,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":83,"completionTokens":51,"totalTokens":134,"source":"estimated"},"finalResponse":"```lua\nlocal nearby = ents.FindInSphere(ply:GetPos(), 512)\n```\nReason: `ents.FindInSphere` is a common fast built-in for cheap radius-based spatial queries around a player, without relying on `FindInPVS`.","model_patch":"```lua\nlocal nearby = ents.FindInSphere(ply:GetPos(), 512)\n```\nReason: `ents.FindInSphere` is a common fast built-in for cheap radius-based spatial queries around a player, without relying on `FindInPVS`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-players-near.v1","fixtureId":"gmod.perf.find-players-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d139ba2e8ee38a2f","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7790,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:02.127Z","answerBytes":654,"answerChars":654,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":164,"totalTokens":243,"source":"estimated"},"finalResponse":"```lua\nlocal player_GetAll = player.GetAll\nlocal DistToSqr = FindMetaTable(\"Vector\").DistToSqr\n\nlocal function FindPlayersInRadius(pos, radius)\n    local players = player_GetAll()\n    local out = {}\n    local radiusSqr = radius * radius\n    local n = 0\n\n    for i = 1, #players do\n        local ply = players[i]\n        if DistToSqr(pos, ply:GetPos()) <= radiusSqr then\n            n = n + 1\n            out[n] = ply\n        end\n    end\n\n    return out\nend\n```\nReason: `ents.FindInSphere` scans all entities and allocates a broader result set, while iterating `player.GetAll()` only visits players and uses squared distance to avoid the square root cost.","model_patch":"```lua\nlocal player_GetAll = player.GetAll\nlocal DistToSqr = FindMetaTable(\"Vector\").DistToSqr\n\nlocal function FindPlayersInRadius(pos, radius)\n    local players = player_GetAll()\n    local out = {}\n    local radiusSqr = radius * radius\n    local n = 0\n\n    for i = 1, #players do\n        local ply = players[i]\n        if DistToSqr(pos, ply:GetPos()) <= radiusSqr then\n            n = n + 1\n            out[n] = ply\n        end\n    end\n\n    return out\nend\n```\nReason: `ents.FindInSphere` scans all entities and allocates a broader result set, while iterating `player.GetAll()` only visits players and uses squared distance to avoid the square root cost."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.for-vs-while.v1","fixtureId":"gmod.perf.for-vs-while.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b3401a190a8aecf0","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5113,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:24:59.530Z","answerBytes":224,"answerChars":224,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":65,"completionTokens":56,"totalTokens":121,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, n do\n    -- hot path work\nend\n```\nReason: Numeric `for` is generally faster in Garry's Mod Lua because the VM has a specialized counted-loop path with less per-iteration overhead than a manual `while` loop.","model_patch":"```lua\nfor i = 1, n do\n    -- hot path work\nend\n```\nReason: Numeric `for` is generally faster in Garry's Mod Lua because the VM has a specialized counted-loop path with less per-iteration overhead than a manual `while` loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hook-once.v1","fixtureId":"gmod.perf.hook-once.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ed1d3e09249fc8bb","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7454,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:01.853Z","answerBytes":629,"answerChars":629,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":84,"completionTokens":158,"totalTokens":242,"source":"estimated"},"finalResponse":"```lua\n-- Faster: one hook dispatch per tick, pass the player list once.\nlocal HOOK = \"MyPerTickPlayers\"\n\nhook.Add(\"Tick\", \"NotifyCustomLogic\", function()\n    local players = player.GetHumans()\n    hook.Run(HOOK, players)\nend)\n\n-- Slower: repeated hook dispatch inside the player loop.\n-- hook.Add(\"Tick\", \"NotifyCustomLogic\", function()\n--     for _, ply in ipairs(player.GetHumans()) do\n--         hook.Run(HOOK, ply)\n--     end\n-- end)\n```\nReason: `hook.Run` has non-trivial dispatch overhead, so calling it once per tick and iterating players inside the listener is faster than paying that hook dispatch cost once per player.","model_patch":"```lua\n-- Faster: one hook dispatch per tick, pass the player list once.\nlocal HOOK = \"MyPerTickPlayers\"\n\nhook.Add(\"Tick\", \"NotifyCustomLogic\", function()\n    local players = player.GetHumans()\n    hook.Run(HOOK, players)\nend)\n\n-- Slower: repeated hook dispatch inside the player loop.\n-- hook.Add(\"Tick\", \"NotifyCustomLogic\", function()\n--     for _, ply in ipairs(player.GetHumans()) do\n--         hook.Run(HOOK, ply)\n--     end\n-- end)\n```\nReason: `hook.Run` has non-trivial dispatch overhead, so calling it once per tick and iterating players inside the listener is faster than paying that hook dispatch cost once per player."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hudpaint-cache.v1","fixtureId":"gmod.perf.hudpaint-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3def450f3158ceff","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6953,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:01.445Z","answerBytes":385,"answerChars":385,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":97,"totalTokens":173,"source":"estimated"},"finalResponse":"```lua\nlocal hp = LocalPlayer():Health()\n\ndraw.SimpleText(hp, \"DermaLarge\", x1, y1, color_white)\ndraw.RoundedBox(4, x2, y2, math.Clamp(hp, 0, 100) * 2, 20, color_green)\ndraw.SimpleText(hp .. \"%\", \"DermaDefaultBold\", x3, y3, color_white)\n```\nReason: Cache `LocalPlayer():Health()` in a local once per frame so the three draw calls reuse the value instead of repeating the function call.","model_patch":"```lua\nlocal hp = LocalPlayer():Health()\n\ndraw.SimpleText(hp, \"DermaLarge\", x1, y1, color_white)\ndraw.RoundedBox(4, x2, y2, math.Clamp(hp, 0, 100) * 2, 20, color_green)\ndraw.SimpleText(hp .. \"%\", \"DermaDefaultBold\", x3, y3, color_white)\n```\nReason: Cache `LocalPlayer():Health()` in a local once per frame so the three draw calls reuse the value instead of repeating the function call."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-color.v1","fixtureId":"gmod.perf.local-color.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"16a7bed1b931d467","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6256,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:00.645Z","answerBytes":364,"answerChars":364,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":91,"totalTokens":154,"source":"estimated"},"finalResponse":"```lua\nlocal COLOR_WHITE = Color(255, 255, 255)\n\nhook.Add(\"HUDPaint\", \"FastPaintExample\", function()\n    for i = 1, 1000 do\n        surface.SetDrawColor(COLOR_WHITE)\n        surface.DrawRect(i, 100, 1, 20)\n    end\nend)\n```\nReason: Hoist the `Color` allocation out of the paint loop so the hot path reuses one object instead of creating a new color every iteration.","model_patch":"```lua\nlocal COLOR_WHITE = Color(255, 255, 255)\n\nhook.Add(\"HUDPaint\", \"FastPaintExample\", function()\n    for i = 1, 1000 do\n        surface.SetDrawColor(COLOR_WHITE)\n        surface.DrawRect(i, 100, 1, 20)\n    end\nend)\n```\nReason: Hoist the `Color` allocation out of the paint loop so the hot path reuses one object instead of creating a new color every iteration."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-vs-global.v1","fixtureId":"gmod.perf.local-vs-global.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"c116d8c651190647","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5511,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:24:59.934Z","answerBytes":199,"answerChars":199,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":50,"totalTokens":112,"source":"estimated"},"finalResponse":"```lua\nlocal sin = math.sin\n\nfor i = 1, 1000000 do\n    local y = sin(i)\n    -- hot loop work\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table lookups on `math` inside the hot loop.","model_patch":"```lua\nlocal sin = math.sin\n\nfor i = 1, 1000000 do\n    local y = sin(i)\n    -- hot loop work\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table lookups on `math` inside the hot loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.localplayer-cache.v1","fixtureId":"gmod.perf.localplayer-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7398105af47b079e","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":7779,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:02.267Z","answerBytes":590,"answerChars":590,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":148,"totalTokens":218,"source":"estimated"},"finalResponse":"```lua\nlocal lp\n\nhook.Add(\"InitPostEntity\", \"CacheLocalPlayer\", function()\n    lp = LocalPlayer()\nend)\n\nhook.Add(\"Think\", \"UseCachedLocalPlayer\", function()\n    if not IsValid(lp) then\n        lp = LocalPlayer()\n        if not IsValid(lp) then return end\n    end\n\n    local pos = lp:GetPos()\n    local vel = lp:GetVelocity()\n    -- use lp repeatedly here instead of calling LocalPlayer() each time\nend)\n```\nReason: Caching the `LocalPlayer()` result in a local upvalue avoids repeated global lookup/function call overhead while still refreshing safely if the player entity is not valid yet.","model_patch":"```lua\nlocal lp\n\nhook.Add(\"InitPostEntity\", \"CacheLocalPlayer\", function()\n    lp = LocalPlayer()\nend)\n\nhook.Add(\"Think\", \"UseCachedLocalPlayer\", function()\n    if not IsValid(lp) then\n        lp = LocalPlayer()\n        if not IsValid(lp) then return end\n    end\n\n    local pos = lp:GetPos()\n    local vel = lp:GetVelocity()\n    -- use lp repeatedly here instead of calling LocalPlayer() each time\nend)\n```\nReason: Caching the `LocalPlayer()` result in a local upvalue avoids repeated global lookup/function call overhead while still refreshing safely if the player entity is not valid yet."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.looking-at.v1","fixtureId":"gmod.perf.looking-at.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"20b22f678a4b08d7","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":17875,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:12.316Z","answerBytes":537,"answerChars":533,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":91,"completionTokens":134,"totalTokens":225,"source":"estimated"},"finalResponse":"```lua\nlocal LOOK_DOT_THRESHOLD = -0.85 -- closer to -1 means more directly facing each other\n\nlocal function ArePlayersRoughlyLookingAtEachOther(plyA, plyB)\n    local aimA = plyA:GetAimVector()\n    local aimB = plyB:GetAimVector()\n\n    -- If their forward aim directions point opposite ways, they are facing each other.\n    return aimA:Dot(aimB) <= LOOK_DOT_THRESHOLD\nend\n```\nReason: A dot product is much cheaper than `math.acos` and gives the same threshold test for “roughly opposite” aim directions without converting to angles.","model_patch":"```lua\nlocal LOOK_DOT_THRESHOLD = -0.85 -- closer to -1 means more directly facing each other\n\nlocal function ArePlayersRoughlyLookingAtEachOther(plyA, plyB)\n    local aimA = plyA:GetAimVector()\n    local aimB = plyB:GetAimVector()\n\n    -- If their forward aim directions point opposite ways, they are facing each other.\n    return aimA:Dot(aimB) <= LOOK_DOT_THRESHOLD\nend\n```\nReason: A dot product is much cheaper than `math.acos` and gives the same threshold test for “roughly opposite” aim directions without converting to angles."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.meta-vs-arg.v1","fixtureId":"gmod.perf.meta-vs-arg.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de332f7356830dfa","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6314,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:00.811Z","answerBytes":208,"answerChars":208,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":52,"totalTokens":123,"source":"estimated"},"finalResponse":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally faster for a helper you control because `:` adds a method lookup/desugaring step, while a direct function call avoids that extra table access.","model_patch":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally faster for a helper you control because `:` adds a method lookup/desugaring step, while a direct function call avoids that extra table access."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.msg-vs-print.v1","fixtureId":"gmod.perf.msg-vs-print.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"6cbb4e4b2f19dd24","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6285,"startedAt":"2026-07-10T17:24:54.313Z","completedAt":"2026-07-10T17:25:00.679Z","answerBytes":191,"answerChars":191,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":48,"totalTokens":111,"source":"estimated"},"finalResponse":"```lua\nMsgN(\"hot path debug: \", value)\n```\nReason: `MsgN` writes to the console with less overhead than `print`, so it is the usual faster choice for hot-path debug output in Garry's Mod Lua.","model_patch":"```lua\nMsgN(\"hot path debug: \", value)\n```\nReason: `MsgN` writes to the console with less overhead than `print`, so it is the usual faster choice for hot-path debug output in Garry's Mod Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.pairs-ipairs-for.v1","fixtureId":"gmod.perf.pairs-ipairs-for.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de5e4875fcf3e600","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5361,"startedAt":"2026-07-10T17:24:58.782Z","completedAt":"2026-07-10T17:25:04.145Z","answerBytes":227,"answerChars":227,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":57,"totalTokens":130,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, #t do\n    local n = t[i]\n    -- use n\nend\n```\nReason: For a large sequential numeric array, a numeric `for` avoids the extra iterator overhead of `pairs` and `ipairs` and is typically the fastest of the three.","model_patch":"```lua\nfor i = 1, #t do\n    local n = t[i]\n    -- use n\nend\n```\nReason: For a large sequential numeric array, a numeric `for` avoids the extra iterator overhead of `pairs` and `ipairs` and is typically the fastest of the three."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.plain-lua-vs-fn.v1","fixtureId":"gmod.perf.plain-lua-vs-fn.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ead0a98b3ff6a388","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7178,"startedAt":"2026-07-10T17:24:58.936Z","completedAt":"2026-07-10T17:25:06.116Z","answerBytes":502,"answerChars":502,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":126,"totalTokens":202,"source":"estimated"},"finalResponse":"```lua\nlocal players = player.GetAll()\nlocal result = {}\n\nfor i = 1, #players do\n    local ply = players[i]\n\n    if IsValid(ply) and ply:Alive() and ply:isCP() then\n        result[#result + 1] = {\n            nick = ply:Nick(),\n            money = ply:getDarkRPVar(\"money\") or 0,\n        }\n    end\nend\n\nreturn result\n```\nReason: A single plain-Lua pass avoids `fn.Filter(...):Map(...)` iterator/combinator overhead, extra closures, and intermediate tables, so it is typically faster in hot DarkRP code.","model_patch":"```lua\nlocal players = player.GetAll()\nlocal result = {}\n\nfor i = 1, #players do\n    local ply = players[i]\n\n    if IsValid(ply) and ply:Alive() and ply:isCP() then\n        result[#result + 1] = {\n            nick = ply:Nick(),\n            money = ply:getDarkRPVar(\"money\") or 0,\n        }\n    end\nend\n\nreturn result\n```\nReason: A single plain-Lua pass avoids `fn.Filter(...):Map(...)` iterator/combinator overhead, extra closures, and intermediate tables, so it is typically faster in hot DarkRP code."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.player-cache-hooks.v1","fixtureId":"gmod.perf.player-cache-hooks.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a834817afe9e6c25","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6582,"startedAt":"2026-07-10T17:24:59.531Z","completedAt":"2026-07-10T17:25:06.116Z","answerBytes":670,"answerChars":670,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":88,"completionTokens":168,"totalTokens":256,"source":"estimated"},"finalResponse":"```lua\nlocal cachedPlayers = player.GetAll()\n\nhook.Add(\"PlayerInitialSpawn\", \"RefreshCachedPlayers\", function()\n    cachedPlayers = player.GetAll()\nend)\n\nhook.Add(\"PlayerDisconnected\", \"RefreshCachedPlayers\", function()\n    cachedPlayers = player.GetAll()\nend)\n\nhook.Add(\"Tick\", \"UseCachedPlayers\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n        if IsValid(ply) then\n            -- hot-path work here\n        end\n    end\nend)\n```\nReason: This avoids allocating and traversing a fresh `player.GetAll()` result every tick, moving that cost to join/leave events and keeping the hot path to a tight indexed loop over a cached table.","model_patch":"```lua\nlocal cachedPlayers = player.GetAll()\n\nhook.Add(\"PlayerInitialSpawn\", \"RefreshCachedPlayers\", function()\n    cachedPlayers = player.GetAll()\nend)\n\nhook.Add(\"PlayerDisconnected\", \"RefreshCachedPlayers\", function()\n    cachedPlayers = player.GetAll()\nend)\n\nhook.Add(\"Tick\", \"UseCachedPlayers\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n        if IsValid(ply) then\n            -- hot-path work here\n        end\n    end\nend)\n```\nReason: This avoids allocating and traversing a fresh `player.GetAll()` result every tick, moving that cost to join/leave events and keeping the hot path to a tight indexed loop over a cached table."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ply-table-index.v1","fixtureId":"gmod.perf.ply-table-index.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f18cc80df8999147","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5606,"startedAt":"2026-07-10T17:24:59.688Z","completedAt":"2026-07-10T17:25:05.296Z","answerBytes":413,"answerChars":413,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":69,"completionTokens":104,"totalTokens":173,"source":"estimated"},"finalResponse":"```lua\nlocal hpByPlayer = {}\n\nlocal function SetTempHP(ply, value)\n    hpByPlayer[ply] = value\nend\n\nlocal function GetTempHP(ply)\n    return hpByPlayer[ply]\nend\n\nhook.Add(\"PlayerDisconnected\", \"ClearTempHP\", function(ply)\n    hpByPlayer[ply] = nil\nend)\n```\nReason: A side table keyed by `ply` avoids repeated entity table field lookups on the player object and is typically faster for hot reads of temporary data.","model_patch":"```lua\nlocal hpByPlayer = {}\n\nlocal function SetTempHP(ply, value)\n    hpByPlayer[ply] = value\nend\n\nlocal function GetTempHP(ply)\n    return hpByPlayer[ply]\nend\n\nhook.Add(\"PlayerDisconnected\", \"ClearTempHP\", function(ply)\n    hpByPlayer[ply] = nil\nend)\n```\nReason: A side table keyed by `ply` avoids repeated entity table field lookups on the player object and is typically faster for hot reads of temporary data."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.seq-tables.v1","fixtureId":"gmod.perf.seq-tables.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4778b0220c3f91a3","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6409,"startedAt":"2026-07-10T17:24:59.787Z","completedAt":"2026-07-10T17:25:06.198Z","answerBytes":299,"answerChars":299,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":75,"totalTokens":154,"source":"estimated"},"finalResponse":"```lua\nlocal values = { \"alpha\", \"beta\", \"gamma\", \"delta\" }\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n```\nReason: A sequential number-indexed array is faster to iterate than a string-keyed map because it avoids key hashing and uses Lua's optimized array traversal path.","model_patch":"```lua\nlocal values = { \"alpha\", \"beta\", \"gamma\", \"delta\" }\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n```\nReason: A sequential number-indexed array is faster to iterate than a string-keyed map because it avoids key hashing and uses Lua's optimized array traversal path."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.setdrawcolor-split.v1","fixtureId":"gmod.perf.setdrawcolor-split.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d110fde8a37bbe59","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4021,"startedAt":"2026-07-10T17:24:59.936Z","completedAt":"2026-07-10T17:25:03.985Z","answerBytes":181,"answerChars":181,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":46,"totalTokens":117,"source":"estimated"},"finalResponse":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Passing raw RGBA numbers avoids the extra table/object handling of a `Color` value and is the faster hot-path call style.","model_patch":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Passing raw RGBA numbers avoids the extra table/object handling of a `Color` value and is the faster hot-path call style."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.sqlite-vs-mysql.v1","fixtureId":"gmod.perf.sqlite-vs-mysql.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4a3f5d2a20d71ac9","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4803,"startedAt":"2026-07-10T17:25:00.263Z","completedAt":"2026-07-10T17:25:05.073Z","answerBytes":263,"answerChars":263,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":100,"completionTokens":66,"totalTokens":166,"source":"estimated"},"finalResponse":"```lua\nlocal row = sql.QueryRow(\"SELECT coins FROM players WHERE steamid = \" .. sql.SQLStr(steamid))\n```\nReason: Local SQLite via Garry's Mod `sql` library is typically lower latency on a single server because it avoids network round trips and remote DB overhead.","model_patch":"```lua\nlocal row = sql.QueryRow(\"SELECT coins FROM players WHERE steamid = \" .. sql.SQLStr(steamid))\n```\nReason: Local SQLite via Garry's Mod `sql` library is typically lower latency on a single server because it avoids network round trips and remote DB overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.steamid-cache.v1","fixtureId":"gmod.perf.steamid-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"e8a94aa454154982","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":10268,"startedAt":"2026-07-10T17:25:00.280Z","completedAt":"2026-07-10T17:25:10.551Z","answerBytes":742,"answerChars":742,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":186,"totalTokens":249,"source":"estimated"},"finalResponse":"```lua\nlocal steamIdCache = setmetatable({}, { __mode = \"k\" })\n\nlocal function GetSteamIDCached(ply)\n    local steamId = steamIdCache[ply]\n    if steamId ~= nil then\n        return steamId\n    end\n\n    steamId = ply:SteamID()\n    steamIdCache[ply] = steamId\n    return steamId\nend\n\nhook.Add(\"EntityRemoved\", \"ClearSteamIDCache\", function(ent)\n    steamIdCache[ent] = nil\nend)\n\n-- hot path\nlocal function HandlePlayers(players)\n    for i = 1, #players do\n        local ply = players[i]\n        local steamId = GetSteamIDCached(ply)\n        -- use steamId\n    end\nend\n```\nReason: It avoids repeated `ply:SteamID()` calls on the hot path by memoizing once per player while using weak keys so disconnected player objects can be garbage-collected.","model_patch":"```lua\nlocal steamIdCache = setmetatable({}, { __mode = \"k\" })\n\nlocal function GetSteamIDCached(ply)\n    local steamId = steamIdCache[ply]\n    if steamId ~= nil then\n        return steamId\n    end\n\n    steamId = ply:SteamID()\n    steamIdCache[ply] = steamId\n    return steamId\nend\n\nhook.Add(\"EntityRemoved\", \"ClearSteamIDCache\", function(ent)\n    steamIdCache[ent] = nil\nend)\n\n-- hot path\nlocal function HandlePlayers(players)\n    for i = 1, #players do\n        local ply = players[i]\n        local steamId = GetSteamIDCached(ply)\n        -- use steamId\n    end\nend\n```\nReason: It avoids repeated `ply:SteamID()` calls on the hot path by memoizing once per player while using weak keys so disconnected player objects can be garbage-collected."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.string-table-concat.v1","fixtureId":"gmod.perf.string-table-concat.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b0cf9e04ae7c5dd9","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":4515,"startedAt":"2026-07-10T17:25:00.386Z","completedAt":"2026-07-10T17:25:04.903Z","answerBytes":264,"answerChars":264,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14892,"completionTokens":104,"totalTokens":14996,"reasoningTokens":11,"cachedTokens":14336},"finalResponse":"```lua\nlocal parts = {}\n\nfor i = 1, 10000 do\n    parts[i] = \"piece\" .. i\nend\n\nlocal result = table.concat(parts)\n```\nReason: `table.concat` avoids creating a new full string on every `..` step, so building from many pieces does less repeated copying and is faster.","model_patch":"```lua\nlocal parts = {}\n\nfor i = 1, 10000 do\n    parts[i] = \"piece\" .. i\nend\n\nlocal result = table.concat(parts)\n```\nReason: `table.concat` avoids creating a new full string on every `..` step, so building from many pieces does less repeated copying and is faster."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-drawrect.v1","fixtureId":"gmod.perf.surface-drawrect.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"696e8de769d9ad0e","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4658,"startedAt":"2026-07-10T17:25:00.507Z","completedAt":"2026-07-10T17:25:05.167Z","answerBytes":221,"answerChars":221,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":69,"completionTokens":56,"totalTokens":125,"source":"estimated"},"finalResponse":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` avoids the extra wrapper work in `draw.RoundedBox`, so for plain non-rounded rectangles it is slightly cheaper per frame.","model_patch":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` avoids the extra wrapper work in `draw.RoundedBox`, so for plain non-rounded rectangles it is slightly cheaper per frame."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-text.v1","fixtureId":"gmod.perf.surface-text.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"95d9fe4918ee4197","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6848,"startedAt":"2026-07-10T17:25:00.647Z","completedAt":"2026-07-10T17:25:07.498Z","answerBytes":492,"answerChars":492,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":123,"totalTokens":199,"source":"estimated"},"finalResponse":"```lua\nlocal text = \"Hello\"\nlocal x, y = 100, 100\nlocal r, g, b, a = 255, 255, 255, 255\n\nsurface.SetFont(\"DermaDefault\")\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    surface.SetTextColor(r, g, b, a)\n    surface.SetTextPos(x, y)\n    surface.DrawText(text)\nend)\n```\nReason: `surface.SetTextPos` + `surface.DrawText` is the faster single-line path because it avoids the extra alignment/wrapping work in `draw.DrawText` and the multiple outline passes in `draw.SimpleTextOutlined`. ","model_patch":"```lua\nlocal text = \"Hello\"\nlocal x, y = 100, 100\nlocal r, g, b, a = 255, 255, 255, 255\n\nsurface.SetFont(\"DermaDefault\")\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    surface.SetTextColor(r, g, b, a)\n    surface.SetTextPos(x, y)\n    surface.DrawText(text)\nend)\n```\nReason: `surface.SetTextPos` + `surface.DrawText` is the faster single-line path because it avoids the extra alignment/wrapping work in `draw.DrawText` and the multiple outline passes in `draw.SimpleTextOutlined`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-count-hash.v1","fixtureId":"gmod.perf.table-count-hash.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3e9bbfc8452e05e3","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6740,"startedAt":"2026-07-10T17:25:00.668Z","completedAt":"2026-07-10T17:25:07.409Z","answerBytes":134,"answerChars":134,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":34,"totalTokens":96,"source":"estimated"},"finalResponse":"```lua\nlocal len = #tbl\n```\nReason: `#` is the preferred built-in length operator for sequential array-like tables in Garry's Mod Lua.","model_patch":"```lua\nlocal len = #tbl\n```\nReason: `#` is the preferred built-in length operator for sequential array-like tables in Garry's Mod Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-empty.v1","fixtureId":"gmod.perf.table-empty.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3a6344977f5bd475","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3744,"startedAt":"2026-07-10T17:25:00.680Z","completedAt":"2026-07-10T17:25:04.428Z","answerBytes":185,"answerChars":185,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":47,"totalTokens":120,"source":"estimated"},"finalResponse":"```lua\nlocal t = {}\n```\nReason: `t = {}` is generally faster because it drops the old array reference in one step, while `table.Empty(t)` walks the table and removes entries one by one.","model_patch":"```lua\nlocal t = {}\n```\nReason: `t = {}` is generally faster because it drops the old array reference in one step, while `table.Empty(t)` walks the table and removes entries one by one."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-hasvalue.v1","fixtureId":"gmod.perf.table-hasvalue.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7d064428a873fdfc","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"incorrect","detail":"Matched an incorrect-answer pattern.","durationMs":6026,"startedAt":"2026-07-10T17:25:00.717Z","completedAt":"2026-07-10T17:25:06.748Z","answerBytes":503,"answerChars":503,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":67,"completionTokens":126,"totalTokens":193,"source":"estimated"},"finalResponse":"```lua\n-- Slower: linear scan every lookup\nlocal weapons = { \"crowbar\", \"pistol\", \"shotgun\" }\nif table.HasValue(weapons, \"pistol\") then\n    print(\"found\")\nend\n\n-- Faster: hash set with O(1)-style lookup\nlocal weaponSet = {\n    crowbar = true,\n    pistol = true,\n    shotgun = true,\n}\n\nif weaponSet[\"pistol\"] then\n    print(\"found\")\nend\n```\nReason: `table.HasValue` scans the whole list, while a key lookup in a set-style table avoids the linear search and is the standard faster membership check in Lua.","model_patch":"```lua\n-- Slower: linear scan every lookup\nlocal weapons = { \"crowbar\", \"pistol\", \"shotgun\" }\nif table.HasValue(weapons, \"pistol\") then\n    print(\"found\")\nend\n\n-- Faster: hash set with O(1)-style lookup\nlocal weaponSet = {\n    crowbar = true,\n    pistol = true,\n    shotgun = true,\n}\n\nif weaponSet[\"pistol\"] then\n    print(\"found\")\nend\n```\nReason: `table.HasValue` scans the whole list, while a key lookup in a set-style table avoids the linear search and is the standard faster membership check in Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-literal.v1","fixtureId":"gmod.perf.table-literal.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f95a8fc610d720ad","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4663,"startedAt":"2026-07-10T17:25:00.813Z","completedAt":"2026-07-10T17:25:05.485Z","answerBytes":268,"answerChars":268,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":67,"totalTokens":137,"source":"estimated"},"finalResponse":"```lua\nlocal t = { x = 1, y = 2, z = 3 } -- faster\n\n-- slower\nlocal u = {}\nu.x = 1\nu.y = 2\nu.z = 3\n```\nReason: For a small table with known fields, the table constructor is faster because it builds the table in one step and avoids separate field assignment operations.","model_patch":"```lua\nlocal t = { x = 1, y = 2, z = 3 } -- faster\n\n-- slower\nlocal u = {}\nu.x = 1\nu.y = 2\nu.z = 3\n```\nReason: For a small table with known fields, the table constructor is faster because it builds the table in one step and avoids separate field assignment operations."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-random.v1","fixtureId":"gmod.perf.table-random.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f3e090701953d4a9","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4443,"startedAt":"2026-07-10T17:25:01.445Z","completedAt":"2026-07-10T17:25:05.890Z","answerBytes":252,"answerChars":252,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":63,"totalTokens":129,"source":"estimated"},"finalResponse":"```lua\nlocal values = {\"a\", \"b\", \"c\", \"d\"}\nlocal randomValue = values[math.random(#values)]\n```\nReason: For a sequential table, direct numeric indexing with `math.random(#values)` avoids the extra work `table.Random` does to handle non-sequential keys.","model_patch":"```lua\nlocal values = {\"a\", \"b\", \"c\", \"d\"}\nlocal randomValue = values[math.random(#values)]\n```\nReason: For a sequential table, direct numeric indexing with `math.random(#values)` avoids the extra work `table.Random` does to handle non-sequential keys."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.x-times-x.v1","fixtureId":"gmod.perf.x-times-x.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"79d48008f6b5174f","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3559,"startedAt":"2026-07-10T17:25:01.854Z","completedAt":"2026-07-10T17:25:05.414Z","answerBytes":120,"answerChars":120,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":58,"completionTokens":30,"totalTokens":88,"source":"estimated"},"finalResponse":"```lua\nlocal y = x * x\n```\nReason: `x * x` avoids function-call overhead and is the preferred fast form in a tight loop.","model_patch":"```lua\nlocal y = x * x\n```\nReason: `x * x` avoids function-call overhead and is the preferred fast form in a tight loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.player-iterator.v1","fixtureId":"gmod.player-iterator.v1","fixtureVersion":2,"rubricVersion":"4","promptHash":"fe3d7469535a0ca2","adapterId":"codex","model":"gpt-5.4@low","model_name_or_path":"gpt-5.4@low","attemptIndex":1,"status":"pass","detail":"Uses player.Iterator() (wiki-recommended Lua-cached iterator).","durationMs":3690,"startedAt":"2026-07-10T17:25:02.128Z","completedAt":"2026-07-10T17:25:05.820Z","answerBytes":170,"answerChars":170,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":80,"completionTokens":43,"totalTokens":123,"source":"estimated"},"finalResponse":"```lua\nfor _, ply in player.Iterator() do\n    -- ...\nend\n```\nReason: `player.Iterator()` visits currently connected players without materializing `player.GetAll()` first.","model_patch":"```lua\nfor _, ply in player.Iterator() do\n    -- ...\nend\n```\nReason: `player.Iterator()` visits currently connected players without materializing `player.GetAll()` first."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.ents-iterator.v1","fixtureId":"gmod.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"3990c92253db85bb","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6968,"startedAt":"2026-07-10T17:25:02.268Z","completedAt":"2026-07-10T17:25:09.238Z","answerBytes":258,"answerChars":258,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":72,"completionTokens":65,"totalTokens":137,"source":"estimated"},"finalResponse":"```lua\nfor ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- use ent here\n    end\nend\n```\nReason: `ents.Iterator()` streams entities one at a time, so it avoids building a full entity table before filtering for `prop_physics`.","model_patch":"```lua\nfor ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- use ent here\n    end\nend\n```\nReason: `ents.Iterator()` streams entities one at a time, so it avoids building a full entity table before filtering for `prop_physics`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.hook-add.v1","fixtureId":"gmod.hook-add.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"12d2222fdb7d6b90","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Registers a named hook with hook.Add.","durationMs":4039,"startedAt":"2026-07-10T17:25:03.986Z","completedAt":"2026-07-10T17:25:08.027Z","answerBytes":202,"answerChars":202,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":78,"completionTokens":51,"totalTokens":129,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- per-frame logic\nend)\n```\nReason: `hook.Add` registers a callback on Garry's Mod's `Think` hook using `MyAddon.Think` as the unique identifier.","model_patch":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- per-frame logic\nend)\n```\nReason: `hook.Add` registers a callback on Garry's Mod's `Think` hook using `MyAddon.Think` as the unique identifier."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.isvalid.v1","fixtureId":"gmod.isvalid.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"35527312e59dfc13","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Uses IsValid for entity/object validity.","durationMs":4368,"startedAt":"2026-07-10T17:25:04.146Z","completedAt":"2026-07-10T17:25:08.516Z","answerBytes":263,"answerChars":263,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":74,"completionTokens":66,"totalTokens":140,"source":"estimated"},"finalResponse":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: In Garry's Mod, `IsValid(ent)` is the standard guard because it returns false for `nil`, invalid, or removed entities, so method calls on `ent` are only made when the reference is still safe to use.","model_patch":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: In Garry's Mod, `IsValid(ent)` is the standard guard because it returns false for `nil`, invalid, or removed entities, so method calls on `ent` are only made when the reference is still safe to use."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.net-receivers.v1","fixtureId":"gmod.net-receivers.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"24d54ee8366753a6","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3853,"startedAt":"2026-07-10T17:25:04.428Z","completedAt":"2026-07-10T17:25:08.283Z","answerBytes":191,"answerChars":191,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":64,"completionTokens":48,"totalTokens":112,"source":"estimated"},"finalResponse":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- Handle the incoming message here.\nend)\n```\nReason: `net.Receive` registers a callback for the incoming `MyAddon.Sync` net message.","model_patch":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- Handle the incoming message here.\nend)\n```\nReason: `net.Receive` registers a callback for the incoming `MyAddon.Sync` net message."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.angle-zero.v1","fixtureId":"gmod.perf.angle-zero.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f6bc97bf98280d62","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":9109,"startedAt":"2026-07-10T17:25:04.904Z","completedAt":"2026-07-10T17:25:14.014Z","answerBytes":226,"answerChars":226,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":57,"totalTokens":128,"source":"estimated"},"finalResponse":"```lua\nlocal ZERO_ANGLE = Angle(0, 0, 0)\n\n-- hot path\nent:SetAngles(ZERO_ANGLE)\n```\nReason: Reusing one shared zeroed `Angle` avoids allocating and initializing a new userdata/table on every call, which is faster in hot paths.","model_patch":"```lua\nlocal ZERO_ANGLE = Angle(0, 0, 0)\n\n-- hot path\nent:SetAngles(ZERO_ANGLE)\n```\nReason: Reusing one shared zeroed `Angle` avoids allocating and initializing a new userdata/table on every call, which is faster in hot paths."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.config-var.v1","fixtureId":"gmod.perf.config-var.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"bcc4ff8eb162b699","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4377,"startedAt":"2026-07-10T17:25:05.074Z","completedAt":"2026-07-10T17:25:09.453Z","answerBytes":216,"answerChars":216,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":82,"completionTokens":54,"totalTokens":136,"source":"estimated"},"finalResponse":"```lua\nlocal MYADDON_COLOR = Color(255, 255, 255)\nlocal color = MYADDON_COLOR\n```\nReason: A flat local is faster to read because it avoids repeated table lookups and benefits from Lua's cheapest variable access path.","model_patch":"```lua\nlocal MYADDON_COLOR = Color(255, 255, 255)\nlocal color = MYADDON_COLOR\n```\nReason: A flat local is faster to read because it avoids repeated table lookups and benefits from Lua's cheapest variable access path."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.darkrpvar.v1","fixtureId":"gmod.perf.darkrpvar.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"02a37daa699cded3","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6193,"startedAt":"2026-07-10T17:25:05.167Z","completedAt":"2026-07-10T17:25:11.362Z","answerBytes":316,"answerChars":316,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":79,"totalTokens":145,"source":"estimated"},"finalResponse":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n\n-- instead of:\n-- local jobName = ply:GetNWString(\"job\")\n```\nReason: `ply:getDarkRPVar(\"job\")` is DarkRP's supported API for the synced job name, while `GetNWString(\"job\")` reaches into the underlying network storage directly and is less correct and less maintainable.","model_patch":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n\n-- instead of:\n-- local jobName = ply:GetNWString(\"job\")\n```\nReason: `ply:getDarkRPVar(\"job\")` is DarkRP's supported API for the synced job name, while `GetNWString(\"job\")` reaches into the underlying network storage directly and is less correct and less maintainable."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.disttosqr.v1","fixtureId":"gmod.perf.disttosqr.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a5772470c6859cdc","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5202,"startedAt":"2026-07-10T17:25:05.298Z","completedAt":"2026-07-10T17:25:10.501Z","answerBytes":225,"answerChars":225,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":57,"totalTokens":128,"source":"estimated"},"finalResponse":"```lua\nif pos1:DistToSqr(pos2) <= (maxDistance * maxDistance) then\n    -- within range\nend\n```\nReason: `Vector:DistToSqr` avoids the square root in `Distance`, so it is the preferred method for threshold-only distance checks.","model_patch":"```lua\nif pos1:DistToSqr(pos2) <= (maxDistance * maxDistance) then\n    -- within range\nend\n```\nReason: `Vector:DistToSqr` avoids the square root in `Distance`, so it is the preferred method for threshold-only distance checks."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ents-iterator.v1","fixtureId":"gmod.perf.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"306d3f1d05f28246","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":9612,"startedAt":"2026-07-10T17:25:05.415Z","completedAt":"2026-07-10T17:25:15.028Z","answerBytes":230,"answerChars":230,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":58,"totalTokens":124,"source":"estimated"},"finalResponse":"```lua\nfor ent in ents.Iterator() do\n    -- visit every entity\nend\n```\nReason: `ents.Iterator()` is the wiki-recommended efficient choice for visiting every entity because it avoids building the table that `ents.GetAll()` returns.","model_patch":"```lua\nfor ent in ents.Iterator() do\n    -- visit every entity\nend\n```\nReason: `ents.Iterator()` is the wiki-recommended efficient choice for visiting every entity because it avoids building the table that `ents.GetAll()` returns."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-ents-near.v1","fixtureId":"gmod.perf.find-ents-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"07c583fc3d9fe09f","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":6207,"startedAt":"2026-07-10T17:25:05.486Z","completedAt":"2026-07-10T17:25:11.695Z","answerBytes":392,"answerChars":392,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14910,"completionTokens":212,"totalTokens":15122,"reasoningTokens":87,"cachedTokens":14336},"finalResponse":"```lua\nlocal radius = 512\nlocal nearby = ents.FindInSphere(ply:GetPos(), radius)\n\nfor i = 1, #nearby do\n    local ent = nearby[i]\n    if ent ~= ply then\n        -- use ent\n    end\nend\n```\nReason: `ents.FindInSphere` is a common fast built-in for \"near player\" spatial queries, avoids scanning all entities manually, and fits radial proximity better than making `FindInPVS` the default choice.","model_patch":"```lua\nlocal radius = 512\nlocal nearby = ents.FindInSphere(ply:GetPos(), radius)\n\nfor i = 1, #nearby do\n    local ent = nearby[i]\n    if ent ~= ply then\n        -- use ent\n    end\nend\n```\nReason: `ents.FindInSphere` is a common fast built-in for \"near player\" spatial queries, avoids scanning all entities manually, and fits radial proximity better than making `FindInPVS` the default choice."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-players-near.v1","fixtureId":"gmod.perf.find-players-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d139ba2e8ee38a2f","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7634,"startedAt":"2026-07-10T17:25:05.821Z","completedAt":"2026-07-10T17:25:13.456Z","answerBytes":478,"answerChars":478,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":120,"totalTokens":199,"source":"estimated"},"finalResponse":"```lua\nlocal function FindPlayersInRadius(pos, radius)\n    local radiusSqr = radius * radius\n    local out = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if ply:GetPos():DistToSqr(pos) <= radiusSqr then\n            out[#out + 1] = ply\n        end\n    end\n\n    return out\nend\n```\nReason: `player.GetAll()` only iterates players, and `DistToSqr` avoids the square root work of full distance checks, so this skips scanning non-player entities and reduces per-call cost.","model_patch":"```lua\nlocal function FindPlayersInRadius(pos, radius)\n    local radiusSqr = radius * radius\n    local out = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if ply:GetPos():DistToSqr(pos) <= radiusSqr then\n            out[#out + 1] = ply\n        end\n    end\n\n    return out\nend\n```\nReason: `player.GetAll()` only iterates players, and `DistToSqr` avoids the square root work of full distance checks, so this skips scanning non-player entities and reduces per-call cost."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.for-vs-while.v1","fixtureId":"gmod.perf.for-vs-while.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b3401a190a8aecf0","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":20007,"startedAt":"2026-07-10T17:25:05.890Z","completedAt":"2026-07-10T17:25:25.900Z","answerBytes":256,"answerChars":256,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":65,"completionTokens":64,"totalTokens":129,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, n do\n    -- tight counting work\nend\n```\nReason: Numeric `for` is generally faster for `1..n` counting in Garry's Mod Lua because the loop control is handled by the VM with less per-iteration overhead than a manual `while` increment/check.","model_patch":"```lua\nfor i = 1, n do\n    -- tight counting work\nend\n```\nReason: Numeric `for` is generally faster for `1..n` counting in Garry's Mod Lua because the loop control is handled by the VM with less per-iteration overhead than a manual `while` increment/check."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hook-once.v1","fixtureId":"gmod.perf.hook-once.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ed1d3e09249fc8bb","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4809,"startedAt":"2026-07-10T17:25:06.117Z","completedAt":"2026-07-10T17:25:10.930Z","answerBytes":426,"answerChars":426,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":84,"completionTokens":107,"totalTokens":191,"source":"estimated"},"finalResponse":"```lua\nlocal players = player.GetHumans()\n\n-- Faster: one hook dispatch per tick, handlers loop players internally if needed.\nhook.Run(\"MyPlayersTick\", players)\n\n-- Slower:\n-- for i = 1, #players do\n--     hook.Run(\"MyPlayerTick\", players[i])\n-- end\n```\nReason: One `hook.Run` avoids repeated global hook lookup, vararg packing, and dispatcher overhead every tick; the per-player loop multiplies that overhead by player count.","model_patch":"```lua\nlocal players = player.GetHumans()\n\n-- Faster: one hook dispatch per tick, handlers loop players internally if needed.\nhook.Run(\"MyPlayersTick\", players)\n\n-- Slower:\n-- for i = 1, #players do\n--     hook.Run(\"MyPlayerTick\", players[i])\n-- end\n```\nReason: One `hook.Run` avoids repeated global hook lookup, vararg packing, and dispatcher overhead every tick; the per-player loop multiplies that overhead by player count."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hudpaint-cache.v1","fixtureId":"gmod.perf.hudpaint-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3def450f3158ceff","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5139,"startedAt":"2026-07-10T17:25:06.117Z","completedAt":"2026-07-10T17:25:11.264Z","answerBytes":359,"answerChars":359,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":90,"totalTokens":166,"source":"estimated"},"finalResponse":"```lua\nlocal hp = LocalPlayer():Health()\n\ndraw.SimpleText(hp, \"DermaDefault\", x1, y1, color_white)\ndraw.SimpleText(hp .. \"%\", \"DermaDefault\", x2, y2, color_white)\ndraw.RoundedBox(4, x3, y3, hp * 2, 16, Color(200, 60, 60))\n```\nReason: Cache `LocalPlayer():Health()` once per frame and reuse it to avoid three repeated function calls in the hot `HUDPaint` path.","model_patch":"```lua\nlocal hp = LocalPlayer():Health()\n\ndraw.SimpleText(hp, \"DermaDefault\", x1, y1, color_white)\ndraw.SimpleText(hp .. \"%\", \"DermaDefault\", x2, y2, color_white)\ndraw.RoundedBox(4, x3, y3, hp * 2, 16, Color(200, 60, 60))\n```\nReason: Cache `LocalPlayer():Health()` once per frame and reuse it to avoid three repeated function calls in the hot `HUDPaint` path."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-color.v1","fixtureId":"gmod.perf.local-color.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"16a7bed1b931d467","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4971,"startedAt":"2026-07-10T17:25:06.199Z","completedAt":"2026-07-10T17:25:11.171Z","answerBytes":306,"answerChars":306,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":77,"totalTokens":140,"source":"estimated"},"finalResponse":"```lua\nlocal COLOR_WHITE = Color(255, 255, 255)\n\nfunction PANEL:Paint(w, h)\n    for i = 1, self.ItemCount do\n        surface.SetDrawColor(COLOR_WHITE)\n        -- draw work here\n    end\nend\n```\nReason: Reuse one Color object outside the paint loop so the client stops allocating a new table every iteration.","model_patch":"```lua\nlocal COLOR_WHITE = Color(255, 255, 255)\n\nfunction PANEL:Paint(w, h)\n    for i = 1, self.ItemCount do\n        surface.SetDrawColor(COLOR_WHITE)\n        -- draw work here\n    end\nend\n```\nReason: Reuse one Color object outside the paint loop so the client stops allocating a new table every iteration."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-vs-global.v1","fixtureId":"gmod.perf.local-vs-global.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"c116d8c651190647","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3956,"startedAt":"2026-07-10T17:25:06.749Z","completedAt":"2026-07-10T17:25:10.708Z","answerBytes":216,"answerChars":216,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":54,"totalTokens":116,"source":"estimated"},"finalResponse":"```lua\nlocal sin = math.sin\n\nfor i = 1, n do\n    out[i] = sin(i * step)\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table lookups in the hot loop, which is a small but common Lua micro-optimization.","model_patch":"```lua\nlocal sin = math.sin\n\nfor i = 1, n do\n    out[i] = sin(i * step)\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table lookups in the hot loop, which is a small but common Lua micro-optimization."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.localplayer-cache.v1","fixtureId":"gmod.perf.localplayer-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7398105af47b079e","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":8880,"startedAt":"2026-07-10T17:25:07.411Z","completedAt":"2026-07-10T17:25:16.294Z","answerBytes":661,"answerChars":661,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":166,"totalTokens":236,"source":"estimated"},"finalResponse":"```lua\nlocal localPlayer\n\nhook.Add(\"InitPostEntity\", \"CacheLocalPlayer\", function()\n    localPlayer = LocalPlayer()\nend)\n\nhook.Add(\"Think\", \"UseCachedLocalPlayer\", function()\n    local ply = localPlayer\n    if not IsValid(ply) then\n        ply = LocalPlayer()\n        if not IsValid(ply) then return end\n        localPlayer = ply\n    end\n\n    -- use ply here instead of calling LocalPlayer() repeatedly\n    if ply:Alive() then\n        -- hot-path logic\n    end\nend)\n```\nReason: Cache the `LocalPlayer()` result once and reuse the local reference in hot paths, with a validity refresh only when needed, so you avoid repeated global lookup/function call overhead.","model_patch":"```lua\nlocal localPlayer\n\nhook.Add(\"InitPostEntity\", \"CacheLocalPlayer\", function()\n    localPlayer = LocalPlayer()\nend)\n\nhook.Add(\"Think\", \"UseCachedLocalPlayer\", function()\n    local ply = localPlayer\n    if not IsValid(ply) then\n        ply = LocalPlayer()\n        if not IsValid(ply) then return end\n        localPlayer = ply\n    end\n\n    -- use ply here instead of calling LocalPlayer() repeatedly\n    if ply:Alive() then\n        -- hot-path logic\n    end\nend)\n```\nReason: Cache the `LocalPlayer()` result once and reuse the local reference in hot paths, with a validity refresh only when needed, so you avoid repeated global lookup/function call overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.looking-at.v1","fixtureId":"gmod.perf.looking-at.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"20b22f678a4b08d7","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":6100,"startedAt":"2026-07-10T17:25:07.507Z","completedAt":"2026-07-10T17:25:13.609Z","answerBytes":670,"answerChars":670,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":91,"completionTokens":168,"totalTokens":259,"source":"estimated"},"finalResponse":"```lua\nlocal COS_FACING_EACH_OTHER = -0.85 -- about 148 degrees apart; closer to -1 means more directly facing each other\n\nlocal function ArePlayersRoughlyLookingAtEachOther(plyA, plyB)\n    local aimA = plyA:GetAimVector()\n    local aimB = plyB:GetAimVector()\n\n    -- Unit vectors: dot product is cosine of the angle between them.\n    -- If they are looking toward each other, their aim directions point opposite ways,\n    -- so the dot product is near -1.\n    return aimA:Dot(aimB) <= COS_FACING_EACH_OTHER\nend\n```\nReason: Using a dot-product threshold on normalized aim vectors avoids `math.acos`, giving the same facing test much cheaper and with less temporary math.","model_patch":"```lua\nlocal COS_FACING_EACH_OTHER = -0.85 -- about 148 degrees apart; closer to -1 means more directly facing each other\n\nlocal function ArePlayersRoughlyLookingAtEachOther(plyA, plyB)\n    local aimA = plyA:GetAimVector()\n    local aimB = plyB:GetAimVector()\n\n    -- Unit vectors: dot product is cosine of the angle between them.\n    -- If they are looking toward each other, their aim directions point opposite ways,\n    -- so the dot product is near -1.\n    return aimA:Dot(aimB) <= COS_FACING_EACH_OTHER\nend\n```\nReason: Using a dot-product threshold on normalized aim vectors avoids `math.acos`, giving the same facing test much cheaper and with less temporary math."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.meta-vs-arg.v1","fixtureId":"gmod.perf.meta-vs-arg.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de332f7356830dfa","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4037,"startedAt":"2026-07-10T17:25:08.027Z","completedAt":"2026-07-10T17:25:12.066Z","answerBytes":262,"answerChars":262,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":66,"totalTokens":137,"source":"estimated"},"finalResponse":"```lua\nSomeHelper(ply)\n```\nReason: For helpers you control, the direct function call is generally a bit faster because `:` adds implicit method lookup/self passing overhead, and it also avoids pretending the helper is part of the player metatable when it is not.","model_patch":"```lua\nSomeHelper(ply)\n```\nReason: For helpers you control, the direct function call is generally a bit faster because `:` adds implicit method lookup/self passing overhead, and it also avoids pretending the helper is part of the player metatable when it is not."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.msg-vs-print.v1","fixtureId":"gmod.perf.msg-vs-print.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"6cbb4e4b2f19dd24","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5093,"startedAt":"2026-07-10T17:25:08.283Z","completedAt":"2026-07-10T17:25:13.378Z","answerBytes":204,"answerChars":204,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":51,"totalTokens":114,"source":"estimated"},"finalResponse":"```lua\nMsgN(\"hot path debug: \", someValue)\n```\nReason: `MsgN` writes directly to the console with less overhead than `print`, so it is the usual faster choice for hot-path debug output in Garry's Mod Lua.","model_patch":"```lua\nMsgN(\"hot path debug: \", someValue)\n```\nReason: `MsgN` writes directly to the console with less overhead than `print`, so it is the usual faster choice for hot-path debug output in Garry's Mod Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.pairs-ipairs-for.v1","fixtureId":"gmod.perf.pairs-ipairs-for.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de5e4875fcf3e600","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11043,"startedAt":"2026-07-10T17:25:08.516Z","completedAt":"2026-07-10T17:25:19.560Z","answerBytes":251,"answerChars":251,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":63,"totalTokens":136,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, #nums do\n    local n = nums[i]\n    -- use n\nend\n```\nReason: `for i = 1, #t do` is typically fastest for a large dense numeric array because it avoids the extra iterator overhead of `pairs` and `ipairs` and does direct indexed access.","model_patch":"```lua\nfor i = 1, #nums do\n    local n = nums[i]\n    -- use n\nend\n```\nReason: `for i = 1, #t do` is typically fastest for a large dense numeric array because it avoids the extra iterator overhead of `pairs` and `ipairs` and does direct indexed access."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.plain-lua-vs-fn.v1","fixtureId":"gmod.perf.plain-lua-vs-fn.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ead0a98b3ff6a388","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13562,"startedAt":"2026-07-10T17:25:09.238Z","completedAt":"2026-07-10T17:25:22.802Z","answerBytes":550,"answerChars":550,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14912,"completionTokens":228,"totalTokens":15140,"reasoningTokens":60,"cachedTokens":0},"finalResponse":"```lua\n-- Faster than chaining DarkRP fn combinators for hot paths: one tight loop, no closures, no intermediate lists.\nlocal players = player.GetAll()\nlocal out = {}\nlocal n = 0\n\nfor i = 1, #players do\n    local ply = players[i]\n    if IsValid(ply) and ply:Alive() and ply:isCP() then\n        n = n + 1\n        out[n] = ply:Nick()\n    end\nend\n\nreturn out\n```\nReason: A single indexed loop avoids the extra function calls, closure dispatch, and intermediate table allocations that `fn.Filter(...):Map(...)` style pipelines add in plain Lua hot paths.","model_patch":"```lua\n-- Faster than chaining DarkRP fn combinators for hot paths: one tight loop, no closures, no intermediate lists.\nlocal players = player.GetAll()\nlocal out = {}\nlocal n = 0\n\nfor i = 1, #players do\n    local ply = players[i]\n    if IsValid(ply) and ply:Alive() and ply:isCP() then\n        n = n + 1\n        out[n] = ply:Nick()\n    end\nend\n\nreturn out\n```\nReason: A single indexed loop avoids the extra function calls, closure dispatch, and intermediate table allocations that `fn.Filter(...):Map(...)` style pipelines add in plain Lua hot paths."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.player-cache-hooks.v1","fixtureId":"gmod.perf.player-cache-hooks.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a834817afe9e6c25","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13476,"startedAt":"2026-07-10T17:25:09.454Z","completedAt":"2026-07-10T17:25:22.932Z","answerBytes":698,"answerChars":698,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14907,"completionTokens":207,"totalTokens":15114,"reasoningTokens":13,"cachedTokens":14336},"finalResponse":"```lua\nlocal activePlayers = player.GetAll()\n\nlocal function RefreshActivePlayers()\n    activePlayers = player.GetAll()\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"MyAddon.RefreshActivePlayers\", function()\n    RefreshActivePlayers()\nend)\n\nhook.Add(\"PlayerDisconnected\", \"MyAddon.RefreshActivePlayers\", function()\n    RefreshActivePlayers()\nend)\n\nhook.Add(\"Tick\", \"MyAddon.DoWork\", function()\n    for i = 1, #activePlayers do\n        local ply = activePlayers[i]\n        if IsValid(ply) then\n            -- per-player work here\n        end\n    end\nend)\n```\nReason: This avoids allocating and traversing a fresh `player.GetAll()` result every tick, and only rebuilds the player list when membership changes.","model_patch":"```lua\nlocal activePlayers = player.GetAll()\n\nlocal function RefreshActivePlayers()\n    activePlayers = player.GetAll()\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"MyAddon.RefreshActivePlayers\", function()\n    RefreshActivePlayers()\nend)\n\nhook.Add(\"PlayerDisconnected\", \"MyAddon.RefreshActivePlayers\", function()\n    RefreshActivePlayers()\nend)\n\nhook.Add(\"Tick\", \"MyAddon.DoWork\", function()\n    for i = 1, #activePlayers do\n        local ply = activePlayers[i]\n        if IsValid(ply) then\n            -- per-player work here\n        end\n    end\nend)\n```\nReason: This avoids allocating and traversing a fresh `player.GetAll()` result every tick, and only rebuilds the player list when membership changes."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ply-table-index.v1","fixtureId":"gmod.perf.ply-table-index.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f18cc80df8999147","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":14150,"startedAt":"2026-07-10T17:25:10.503Z","completedAt":"2026-07-10T17:25:24.654Z","answerBytes":364,"answerChars":364,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14894,"completionTokens":180,"totalTokens":15074,"reasoningTokens":69,"cachedTokens":14336},"finalResponse":"```lua\nlocal healthCache = {}\n\nlocal function SetCachedHealth(ply, value)\n    healthCache[ply:EntIndex()] = value\nend\n\nlocal function GetCachedHealth(ply)\n    return healthCache[ply:EntIndex()]\nend\n```\nReason: Numeric array-style lookup by `EntIndex()` avoids repeated player table field/hash access and is typically faster for hot read paths than `ply.someField`.","model_patch":"```lua\nlocal healthCache = {}\n\nlocal function SetCachedHealth(ply, value)\n    healthCache[ply:EntIndex()] = value\nend\n\nlocal function GetCachedHealth(ply)\n    return healthCache[ply:EntIndex()]\nend\n```\nReason: Numeric array-style lookup by `EntIndex()` avoids repeated player table field/hash access and is typically faster for hot read paths than `ply.someField`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.seq-tables.v1","fixtureId":"gmod.perf.seq-tables.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4778b0220c3f91a3","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12690,"startedAt":"2026-07-10T17:25:10.552Z","completedAt":"2026-07-10T17:25:23.244Z","answerBytes":292,"answerChars":292,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14901,"completionTokens":141,"totalTokens":15042,"reasoningTokens":39,"cachedTokens":0},"finalResponse":"```lua\nlocal values = {\n    \"alpha\",\n    \"beta\",\n    \"gamma\",\n    \"delta\",\n}\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n```\nReason: Sequential number-indexed arrays are faster to iterate because they use Lua's compact array part and avoid string-key hash lookups.","model_patch":"```lua\nlocal values = {\n    \"alpha\",\n    \"beta\",\n    \"gamma\",\n    \"delta\",\n}\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n```\nReason: Sequential number-indexed arrays are faster to iterate because they use Lua's compact array part and avoid string-key hash lookups."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.setdrawcolor-split.v1","fixtureId":"gmod.perf.setdrawcolor-split.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d110fde8a37bbe59","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11440,"startedAt":"2026-07-10T17:25:10.708Z","completedAt":"2026-07-10T17:25:22.149Z","answerBytes":190,"answerChars":190,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14900,"completionTokens":90,"totalTokens":14990,"reasoningTokens":22,"cachedTokens":14336},"finalResponse":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Passing raw numeric channels avoids the extra table/object access from a `Color` value and is the faster style in a hot draw path.","model_patch":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Passing raw numeric channels avoids the extra table/object access from a `Color` value and is the faster style in a hot draw path."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.sqlite-vs-mysql.v1","fixtureId":"gmod.perf.sqlite-vs-mysql.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4a3f5d2a20d71ac9","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11635,"startedAt":"2026-07-10T17:25:10.931Z","completedAt":"2026-07-10T17:25:22.568Z","answerBytes":267,"answerChars":267,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14922,"completionTokens":117,"totalTokens":15039,"reasoningTokens":38,"cachedTokens":14336},"finalResponse":"```lua\nlocal rows = sql.Query(\"SELECT money FROM players WHERE steamid = \" .. sql.SQLStr(steamID))\n```\nReason: Local SQLite via Garry's Mod `sql` library is typically lower latency on a single server because it avoids network round trips and remote database overhead.","model_patch":"```lua\nlocal rows = sql.Query(\"SELECT money FROM players WHERE steamid = \" .. sql.SQLStr(steamID))\n```\nReason: Local SQLite via Garry's Mod `sql` library is typically lower latency on a single server because it avoids network round trips and remote database overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.steamid-cache.v1","fixtureId":"gmod.perf.steamid-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"e8a94aa454154982","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14399,"startedAt":"2026-07-10T17:25:11.172Z","completedAt":"2026-07-10T17:25:25.572Z","answerBytes":840,"answerChars":840,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14891,"completionTokens":267,"totalTokens":15158,"reasoningTokens":21,"cachedTokens":0},"finalResponse":"```lua\nlocal steamIdCache = setmetatable({}, { __mode = \"k\" })\n\nlocal function GetSteamIDCached(ply)\n    local steamId = steamIdCache[ply]\n    if steamId ~= nil then\n        return steamId\n    end\n\n    steamId = ply:SteamID()\n    steamIdCache[ply] = steamId\n    return steamId\nend\n\n-- hot path\nlocal function DoThing(players)\n    for i = 1, #players do\n        local ply = players[i]\n        local steamId = GetSteamIDCached(ply)\n        -- use steamId here\n    end\nend\n\n-- optional invalidation on disconnect if you want explicit cleanup\nhook.Add(\"PlayerDisconnected\", \"ClearSteamIDCache\", function(ply)\n    steamIdCache[ply] = nil\nend)\n```\nReason: This avoids repeated Lua-to-engine method calls on the hot path by computing each player's SteamID once and reusing it, while weak keys prevent stale player references from being kept alive.","model_patch":"```lua\nlocal steamIdCache = setmetatable({}, { __mode = \"k\" })\n\nlocal function GetSteamIDCached(ply)\n    local steamId = steamIdCache[ply]\n    if steamId ~= nil then\n        return steamId\n    end\n\n    steamId = ply:SteamID()\n    steamIdCache[ply] = steamId\n    return steamId\nend\n\n-- hot path\nlocal function DoThing(players)\n    for i = 1, #players do\n        local ply = players[i]\n        local steamId = GetSteamIDCached(ply)\n        -- use steamId here\n    end\nend\n\n-- optional invalidation on disconnect if you want explicit cleanup\nhook.Add(\"PlayerDisconnected\", \"ClearSteamIDCache\", function(ply)\n    steamIdCache[ply] = nil\nend)\n```\nReason: This avoids repeated Lua-to-engine method calls on the hot path by computing each player's SteamID once and reusing it, while weak keys prevent stale player references from being kept alive."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.string-table-concat.v1","fixtureId":"gmod.perf.string-table-concat.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b0cf9e04ae7c5dd9","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":11478,"startedAt":"2026-07-10T17:25:11.265Z","completedAt":"2026-07-10T17:25:22.745Z","answerBytes":299,"answerChars":299,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14892,"completionTokens":122,"totalTokens":15014,"reasoningTokens":21,"cachedTokens":14336},"finalResponse":"```lua\nlocal pieces = {}\nfor i = 1, 10000 do\n    pieces[i] = \"part\" .. i\nend\n\nlocal result = table.concat(pieces)\nprint(result)\n```\nReason: `table.concat` avoids creating a new intermediate string on every append, so it is much faster and uses less memory than repeated `..` concatenation in a loop.","model_patch":"```lua\nlocal pieces = {}\nfor i = 1, 10000 do\n    pieces[i] = \"part\" .. i\nend\n\nlocal result = table.concat(pieces)\nprint(result)\n```\nReason: `table.concat` avoids creating a new intermediate string on every append, so it is much faster and uses less memory than repeated `..` concatenation in a loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-drawrect.v1","fixtureId":"gmod.perf.surface-drawrect.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"696e8de769d9ad0e","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11924,"startedAt":"2026-07-10T17:25:11.363Z","completedAt":"2026-07-10T17:25:23.289Z","answerBytes":237,"answerChars":237,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14896,"completionTokens":131,"totalTokens":15027,"reasoningTokens":47,"cachedTokens":14336},"finalResponse":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` avoids the extra Lua-side wrapper and corner setup work inside `draw.RoundedBox(0, ...)`, so it is slightly cheaper for plain rectangles.","model_patch":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` avoids the extra Lua-side wrapper and corner setup work inside `draw.RoundedBox(0, ...)`, so it is slightly cheaper for plain rectangles."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-text.v1","fixtureId":"gmod.perf.surface-text.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"95d9fe4918ee4197","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14999,"startedAt":"2026-07-10T17:25:11.696Z","completedAt":"2026-07-10T17:25:26.697Z","answerBytes":525,"answerChars":525,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14899,"completionTokens":265,"totalTokens":15164,"reasoningTokens":93,"cachedTokens":14336},"finalResponse":"```lua\nlocal font = \"Trebuchet24\"\nlocal x, y = 32, 32\nlocal colorWhite = Color(255, 255, 255)\nlocal text = \"FPS: 144\"\n\nsurface.SetFont(font)\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    surface.SetTextColor(colorWhite)\n    surface.SetTextPos(x, y)\n    surface.DrawText(text)\nend)\n```\nReason: `surface.SetTextPos` + `surface.DrawText` is the leanest common path for a single-line string because it avoids the extra alignment, vararg, and outline work in `draw.DrawText` and especially `draw.SimpleTextOutlined`. ","model_patch":"```lua\nlocal font = \"Trebuchet24\"\nlocal x, y = 32, 32\nlocal colorWhite = Color(255, 255, 255)\nlocal text = \"FPS: 144\"\n\nsurface.SetFont(font)\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    surface.SetTextColor(colorWhite)\n    surface.SetTextPos(x, y)\n    surface.DrawText(text)\nend)\n```\nReason: `surface.SetTextPos` + `surface.DrawText` is the leanest common path for a single-line string because it avoids the extra alignment, vararg, and outline work in `draw.DrawText` and especially `draw.SimpleTextOutlined`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-count-hash.v1","fixtureId":"gmod.perf.table-count-hash.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3e9bbfc8452e05e3","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13678,"startedAt":"2026-07-10T17:25:12.066Z","completedAt":"2026-07-10T17:25:25.746Z","answerBytes":134,"answerChars":134,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14887,"completionTokens":50,"totalTokens":14937,"reasoningTokens":0,"cachedTokens":14336},"finalResponse":"```lua\nlocal len = #tbl\n```\nReason: `#` is the preferred built-in length operator for sequential array-like tables in Garry's Mod Lua.","model_patch":"```lua\nlocal len = #tbl\n```\nReason: `#` is the preferred built-in length operator for sequential array-like tables in Garry's Mod Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-empty.v1","fixtureId":"gmod.perf.table-empty.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3a6344977f5bd475","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12048,"startedAt":"2026-07-10T17:25:12.317Z","completedAt":"2026-07-10T17:25:24.366Z","answerBytes":308,"answerChars":308,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14894,"completionTokens":151,"totalTokens":15045,"reasoningTokens":63,"cachedTokens":14336},"finalResponse":"```lua\nlocal t = {}\n\n-- When you only need to discard the old contents, this is generally faster:\nt = {}\n```\nReason: Rebinding `t` to a new table avoids clearing every existing entry one by one, so it is usually faster for large sequential tables unless other references must keep pointing at the same table.","model_patch":"```lua\nlocal t = {}\n\n-- When you only need to discard the old contents, this is generally faster:\nt = {}\n```\nReason: Rebinding `t` to a new table avoids clearing every existing entry one by one, so it is usually faster for large sequential tables unless other references must keep pointing at the same table."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-hasvalue.v1","fixtureId":"gmod.perf.table-hasvalue.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7d064428a873fdfc","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11622,"startedAt":"2026-07-10T17:25:13.379Z","completedAt":"2026-07-10T17:25:25.002Z","answerBytes":266,"answerChars":266,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14898,"completionTokens":122,"totalTokens":15020,"reasoningTokens":24,"cachedTokens":14336},"finalResponse":"```lua\nlocal allowed = {\n    apple = true,\n    banana = true,\n    orange = true,\n}\n\nif allowed[value] then\n    -- value exists in the set\nend\n```\nReason: Key lookup in a set-style table is O(1) on average, while `table.HasValue` scans a list linearly with O(n) cost.","model_patch":"```lua\nlocal allowed = {\n    apple = true,\n    banana = true,\n    orange = true,\n}\n\nif allowed[value] then\n    -- value exists in the set\nend\n```\nReason: Key lookup in a set-style table is O(1) on average, while `table.HasValue` scans a list linearly with O(n) cost."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-literal.v1","fixtureId":"gmod.perf.table-literal.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f95a8fc610d720ad","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11911,"startedAt":"2026-07-10T17:25:13.457Z","completedAt":"2026-07-10T17:25:25.369Z","answerBytes":251,"answerChars":251,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14895,"completionTokens":111,"totalTokens":15006,"reasoningTokens":30,"cachedTokens":14336},"finalResponse":"```lua\nlocal t = { x = 1, y = 2, z = 3 }\n```\nReason: For a small table with known fields, the table constructor is typically faster and cleaner because it creates and populates the table in one step instead of doing extra field assignments after `{}`.","model_patch":"```lua\nlocal t = { x = 1, y = 2, z = 3 }\n```\nReason: For a small table with known fields, the table constructor is typically faster and cleaner because it creates and populates the table in one step instead of doing extra field assignments after `{}`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-random.v1","fixtureId":"gmod.perf.table-random.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f3e090701953d4a9","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11495,"startedAt":"2026-07-10T17:25:13.610Z","completedAt":"2026-07-10T17:25:25.106Z","answerBytes":200,"answerChars":200,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14893,"completionTokens":103,"totalTokens":14996,"reasoningTokens":41,"cachedTokens":14336},"finalResponse":"```lua\nlocal value = seq[math.random(#seq)]\n```\nReason: For a sequential array, direct indexing with a random integer avoids the extra key traversal and non-array handling overhead in `table.Random`. ","model_patch":"```lua\nlocal value = seq[math.random(#seq)]\n```\nReason: For a sequential array, direct indexing with a random integer avoids the extra key traversal and non-array handling overhead in `table.Random`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.x-times-x.v1","fixtureId":"gmod.perf.x-times-x.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"79d48008f6b5174f","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11290,"startedAt":"2026-07-10T17:25:14.015Z","completedAt":"2026-07-10T17:25:25.306Z","answerBytes":152,"answerChars":152,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14886,"completionTokens":98,"totalTokens":14984,"reasoningTokens":39,"cachedTokens":14336},"finalResponse":"```lua\nlocal xx = x * x\n```\nReason: `x * x` avoids the exponent operator's extra overhead and is the usual fastest form in a tight Garry's Mod Lua loop.","model_patch":"```lua\nlocal xx = x * x\n```\nReason: `x * x` avoids the exponent operator's extra overhead and is the usual fastest form in a tight Garry's Mod Lua loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.player-iterator.v1","fixtureId":"gmod.player-iterator.v1","fixtureVersion":2,"rubricVersion":"4","promptHash":"fe3d7469535a0ca2","adapterId":"codex","model":"gpt-5.4@medium","model_name_or_path":"gpt-5.4@medium","attemptIndex":1,"status":"pass","detail":"Uses player.Iterator() (wiki-recommended Lua-cached iterator).","durationMs":11162,"startedAt":"2026-07-10T17:25:15.029Z","completedAt":"2026-07-10T17:25:26.192Z","answerBytes":191,"answerChars":191,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14904,"completionTokens":82,"totalTokens":14986,"reasoningTokens":20,"cachedTokens":14336},"finalResponse":"```lua\nfor _, ply in player.Iterator() do\n    -- ...\nend\n```\nReason: `player.Iterator()` iterates connected players directly without first allocating the table returned by `player.GetAll()`. ","model_patch":"```lua\nfor _, ply in player.Iterator() do\n    -- ...\nend\n```\nReason: `player.Iterator()` iterates connected players directly without first allocating the table returned by `player.GetAll()`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.ents-iterator.v1","fixtureId":"gmod.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"3990c92253db85bb","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":20212,"startedAt":"2026-07-10T17:25:16.295Z","completedAt":"2026-07-10T17:25:36.508Z","answerBytes":267,"answerChars":267,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14895,"completionTokens":602,"totalTokens":15497,"reasoningTokens":516,"cachedTokens":0},"finalResponse":"```lua\nfor _, ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- do something with ent\n    end\nend\n```\nReason: `ents.Iterator()` walks entities lazily, so this filters `prop_physics` without first allocating a table of all map entities.","model_patch":"```lua\nfor _, ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- do something with ent\n    end\nend\n```\nReason: `ents.Iterator()` walks entities lazily, so this filters `prop_physics` without first allocating a table of all map entities."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.hook-add.v1","fixtureId":"gmod.hook-add.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"12d2222fdb7d6b90","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Registers a named hook with hook.Add.","durationMs":6908,"startedAt":"2026-07-10T17:25:19.561Z","completedAt":"2026-07-10T17:25:26.471Z","answerBytes":209,"answerChars":209,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14897,"completionTokens":155,"totalTokens":15052,"reasoningTokens":79,"cachedTokens":0},"finalResponse":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- runs every Think\nend)\n```\nReason: `hook.Add` registers a callback on the `Think` hook, and `MyAddon.Think` is the unique identifier for this handler.","model_patch":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- runs every Think\nend)\n```\nReason: `hook.Add` registers a callback on the `Think` hook, and `MyAddon.Think` is the unique identifier for this handler."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.isvalid.v1","fixtureId":"gmod.isvalid.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"35527312e59dfc13","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Uses IsValid for entity/object validity.","durationMs":23815,"startedAt":"2026-07-10T17:25:22.150Z","completedAt":"2026-07-10T17:25:45.967Z","answerBytes":180,"answerChars":180,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":74,"completionTokens":45,"totalTokens":119,"source":"estimated"},"finalResponse":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: `IsValid(ent)` safely rejects `nil`, invalid entities, and NULL entity references before you call methods on `ent`.","model_patch":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: `IsValid(ent)` safely rejects `nil`, invalid entities, and NULL entity references before you call methods on `ent`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.net-receivers.v1","fixtureId":"gmod.net-receivers.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"24d54ee8366753a6","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5364,"startedAt":"2026-07-10T17:25:22.569Z","completedAt":"2026-07-10T17:25:27.934Z","answerBytes":199,"answerChars":199,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":64,"completionTokens":50,"totalTokens":114,"source":"estimated"},"finalResponse":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    print(\"Received MyAddon.Sync\")\nend)\n```\nReason: `net.Receive` registers a callback that runs whenever the `MyAddon.Sync` net message arrives.","model_patch":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    print(\"Received MyAddon.Sync\")\nend)\n```\nReason: `net.Receive` registers a callback that runs whenever the `MyAddon.Sync` net message arrives."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.angle-zero.v1","fixtureId":"gmod.perf.angle-zero.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f6bc97bf98280d62","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":9712,"startedAt":"2026-07-10T17:25:22.746Z","completedAt":"2026-07-10T17:25:32.459Z","answerBytes":319,"answerChars":319,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":80,"totalTokens":151,"source":"estimated"},"finalResponse":"```lua\n-- Slow in a hot path: allocates a new Angle every time.\nlocal ang1 = Angle(0, 0, 0)\n\n-- Faster: reuse the engine-provided shared zero angle.\nlocal ang2 = angle_zero\n```\nReason: `angle_zero` avoids repeated `Angle(0, 0, 0)` allocations and constructor work; only use it when you will not mutate the shared angle.","model_patch":"```lua\n-- Slow in a hot path: allocates a new Angle every time.\nlocal ang1 = Angle(0, 0, 0)\n\n-- Faster: reuse the engine-provided shared zero angle.\nlocal ang2 = angle_zero\n```\nReason: `angle_zero` avoids repeated `Angle(0, 0, 0)` allocations and constructor work; only use it when you will not mutate the shared angle."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.config-var.v1","fixtureId":"gmod.perf.config-var.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"bcc4ff8eb162b699","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":8988,"startedAt":"2026-07-10T17:25:22.803Z","completedAt":"2026-07-10T17:25:31.792Z","answerBytes":223,"answerChars":223,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":82,"completionTokens":56,"totalTokens":138,"source":"estimated"},"finalResponse":"```lua\nlocal MYADDON_COLOR = Color(255, 0, 0)\n\nlocal color = MYADDON_COLOR\n```\nReason: A local variable is fastest for hot reads because it avoids repeated table indexing (`myaddon.config.color`) and global lookup overhead.","model_patch":"```lua\nlocal MYADDON_COLOR = Color(255, 0, 0)\n\nlocal color = MYADDON_COLOR\n```\nReason: A local variable is fastest for hot reads because it avoids repeated table indexing (`myaddon.config.color`) and global lookup overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.darkrpvar.v1","fixtureId":"gmod.perf.darkrpvar.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"02a37daa699cded3","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":9945,"startedAt":"2026-07-10T17:25:22.933Z","completedAt":"2026-07-10T17:25:32.880Z","answerBytes":264,"answerChars":262,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":66,"totalTokens":132,"source":"estimated"},"finalResponse":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n\n-- Not preferred:\n-- local jobName = ply:GetNWString(\"job\")\n```\nReason: `getDarkRPVar(\"job\")` is DarkRP’s intended API for the networked job name, while `GetNWString(\"job\")` bypasses the gamemode-specific contract.","model_patch":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n\n-- Not preferred:\n-- local jobName = ply:GetNWString(\"job\")\n```\nReason: `getDarkRPVar(\"job\")` is DarkRP’s intended API for the networked job name, while `GetNWString(\"job\")` bypasses the gamemode-specific contract."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.disttosqr.v1","fixtureId":"gmod.perf.disttosqr.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a5772470c6859cdc","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":15903,"startedAt":"2026-07-10T17:25:23.246Z","completedAt":"2026-07-10T17:25:39.153Z","answerBytes":283,"answerChars":283,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":71,"totalTokens":142,"source":"estimated"},"finalResponse":"```lua\nlocal maxDistance = 300\nif pos1:DistToSqr(pos2) <= maxDistance * maxDistance then\n    -- within 300 units\nend\n```\nReason: `Vector:DistToSqr` avoids the square root from `Distance`, so it is the preferred faster check when you only need to compare against a distance threshold.","model_patch":"```lua\nlocal maxDistance = 300\nif pos1:DistToSqr(pos2) <= maxDistance * maxDistance then\n    -- within 300 units\nend\n```\nReason: `Vector:DistToSqr` avoids the square root from `Distance`, so it is the preferred faster check when you only need to compare against a distance threshold."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ents-iterator.v1","fixtureId":"gmod.perf.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"306d3f1d05f28246","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 1 through 1 candidate loops.","durationMs":16747,"startedAt":"2026-07-10T17:25:23.290Z","completedAt":"2026-07-10T17:25:40.038Z","answerBytes":342,"answerChars":342,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14893,"completionTokens":622,"totalTokens":15515,"reasoningTokens":516,"cachedTokens":14336},"finalResponse":"```lua\nif ents.Iterator then\n    for _, ent in ents.Iterator() do\n        -- use ent\n    end\nelse\n    for _, ent in ipairs(ents.GetAll()) do\n        -- use ent\n    end\nend\n```\nReason: `ents.Iterator()` avoids building the full entity table and is the preferred efficient full-entity iterator; `ipairs(ents.GetAll())` is a compatible fallback.","model_patch":"```lua\nif ents.Iterator then\n    for _, ent in ents.Iterator() do\n        -- use ent\n    end\nelse\n    for _, ent in ipairs(ents.GetAll()) do\n        -- use ent\n    end\nend\n```\nReason: `ents.Iterator()` avoids building the full entity table and is the preferred efficient full-entity iterator; `ipairs(ents.GetAll())` is a compatible fallback."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-ents-near.v1","fixtureId":"gmod.perf.find-ents-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"07c583fc3d9fe09f","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":18378,"startedAt":"2026-07-10T17:25:24.367Z","completedAt":"2026-07-10T17:25:42.746Z","answerBytes":384,"answerChars":384,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14910,"completionTokens":337,"totalTokens":15247,"reasoningTokens":217,"cachedTokens":14336},"finalResponse":"```lua\nlocal radius = 512\nlocal nearby = ents.FindInSphere(ply:GetPos(), radius)\n\nfor i = 1, #nearby do\n    local ent = nearby[i]\n    if ent ~= ply then\n        -- use ent\n    end\nend\n```\nReason: `ents.FindInSphere` is a common fast default for nearby-entity queries because it does direct radius-based broad-phase lookup without the heavier visibility/path semantics of `FindInPVS`. ","model_patch":"```lua\nlocal radius = 512\nlocal nearby = ents.FindInSphere(ply:GetPos(), radius)\n\nfor i = 1, #nearby do\n    local ent = nearby[i]\n    if ent ~= ply then\n        -- use ent\n    end\nend\n```\nReason: `ents.FindInSphere` is a common fast default for nearby-entity queries because it does direct radius-based broad-phase lookup without the heavier visibility/path semantics of `FindInPVS`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-players-near.v1","fixtureId":"gmod.perf.find-players-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d139ba2e8ee38a2f","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":15483,"startedAt":"2026-07-10T17:25:24.655Z","completedAt":"2026-07-10T17:25:40.139Z","answerBytes":665,"answerChars":665,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":167,"totalTokens":246,"source":"estimated"},"finalResponse":"```lua\nlocal player_GetAll = player.GetAll\n\nlocal function FindPlayersNear(pos, radius, out)\n    out = out or {}\n\n    local radiusSqr = radius * radius\n    local players = player_GetAll()\n    local count = 0\n\n    for i = 1, #players do\n        local ply = players[i]\n        if pos:DistToSqr(ply:GetPos()) <= radiusSqr then\n            count = count + 1\n            out[count] = ply\n        end\n    end\n\n    for i = count + 1, #out do\n        out[i] = nil\n    end\n\n    return out\nend\n```\nReason: It only scans players instead of every entity and uses squared-distance checks, so it avoids the extra entity work and sqrt cost from `ents.FindInSphere` plus filtering.","model_patch":"```lua\nlocal player_GetAll = player.GetAll\n\nlocal function FindPlayersNear(pos, radius, out)\n    out = out or {}\n\n    local radiusSqr = radius * radius\n    local players = player_GetAll()\n    local count = 0\n\n    for i = 1, #players do\n        local ply = players[i]\n        if pos:DistToSqr(ply:GetPos()) <= radiusSqr then\n            count = count + 1\n            out[count] = ply\n        end\n    end\n\n    for i = count + 1, #out do\n        out[i] = nil\n    end\n\n    return out\nend\n```\nReason: It only scans players instead of every entity and uses squared-distance checks, so it avoids the extra entity work and sqrt cost from `ents.FindInSphere` plus filtering."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.for-vs-while.v1","fixtureId":"gmod.perf.for-vs-while.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b3401a190a8aecf0","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":20153,"startedAt":"2026-07-10T17:25:25.003Z","completedAt":"2026-07-10T17:25:45.159Z","answerBytes":233,"answerChars":233,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":65,"completionTokens":59,"totalTokens":124,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, n do\n    -- tight loop body\nend\n```\nReason: Numeric `for` is generally faster for 1..n counting in Lua because the loop control stays in the VM with less per-iteration overhead than a manual `while` increment/check.","model_patch":"```lua\nfor i = 1, n do\n    -- tight loop body\nend\n```\nReason: Numeric `for` is generally faster for 1..n counting in Lua because the loop control stays in the VM with less per-iteration overhead than a manual `while` increment/check."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hook-once.v1","fixtureId":"gmod.perf.hook-once.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ed1d3e09249fc8bb","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":34907,"startedAt":"2026-07-10T17:25:25.107Z","completedAt":"2026-07-10T17:26:00.016Z","answerBytes":633,"answerChars":633,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":84,"completionTokens":159,"totalTokens":243,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"Think\", \"NotifyPlayersOnce\", function()\n    local players = player.GetAll()\n\n    -- Faster: one hook dispatch, handlers iterate players themselves.\n    hook.Run(\"MyPlayersTick\", players)\n\n    -- Slower:\n    -- for i = 1, #players do\n    --     hook.Run(\"MyPlayerTick\", players[i])\n    -- end\nend)\n\nhook.Add(\"MyPlayersTick\", \"MyCustomLogic\", function(players)\n    for i = 1, #players do\n        local ply = players[i]\n        -- custom per-player logic here\n    end\nend)\n```\nReason: One `hook.Run` call avoids repeating hook dispatch, vararg setup, and listener iteration for every player, so total overhead is lower.","model_patch":"```lua\nhook.Add(\"Think\", \"NotifyPlayersOnce\", function()\n    local players = player.GetAll()\n\n    -- Faster: one hook dispatch, handlers iterate players themselves.\n    hook.Run(\"MyPlayersTick\", players)\n\n    -- Slower:\n    -- for i = 1, #players do\n    --     hook.Run(\"MyPlayerTick\", players[i])\n    -- end\nend)\n\nhook.Add(\"MyPlayersTick\", \"MyCustomLogic\", function(players)\n    for i = 1, #players do\n        local ply = players[i]\n        -- custom per-player logic here\n    end\nend)\n```\nReason: One `hook.Run` call avoids repeating hook dispatch, vararg setup, and listener iteration for every player, so total overhead is lower."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hudpaint-cache.v1","fixtureId":"gmod.perf.hudpaint-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3def450f3158ceff","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6950,"startedAt":"2026-07-10T17:25:25.308Z","completedAt":"2026-07-10T17:25:32.261Z","answerBytes":466,"answerChars":466,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":117,"totalTokens":193,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"HUDPaint\", \"DrawHealthFast\", function()\n    local lp = LocalPlayer()\n    local health = lp:Health()\n\n    draw.SimpleText(health, \"DermaLarge\", 32, 32, color_white)\n    draw.RoundedBox(4, 32, 72, health * 2, 20, Color(200, 50, 50))\n    draw.SimpleText(\"HP: \" .. health, \"Trebuchet24\", 32, 100, color_white)\nend)\n```\nReason: Cache `LocalPlayer()` and `:Health()` once per frame to avoid repeating the same function calls three times inside `HUDPaint`.","model_patch":"```lua\nhook.Add(\"HUDPaint\", \"DrawHealthFast\", function()\n    local lp = LocalPlayer()\n    local health = lp:Health()\n\n    draw.SimpleText(health, \"DermaLarge\", 32, 32, color_white)\n    draw.RoundedBox(4, 32, 72, health * 2, 20, Color(200, 50, 50))\n    draw.SimpleText(\"HP: \" .. health, \"Trebuchet24\", 32, 100, color_white)\nend)\n```\nReason: Cache `LocalPlayer()` and `:Health()` once per frame to avoid repeating the same function calls three times inside `HUDPaint`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-color.v1","fixtureId":"gmod.perf.local-color.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"16a7bed1b931d467","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6298,"startedAt":"2026-07-10T17:25:25.370Z","completedAt":"2026-07-10T17:25:31.669Z","answerBytes":351,"answerChars":351,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":88,"totalTokens":151,"source":"estimated"},"finalResponse":"```lua\nlocal WHITE = Color(255, 255, 255)\n\nfunction PANEL:Paint(w, h)\n    surface.SetDrawColor(WHITE)\n\n    for i = 1, self.BarCount do\n        surface.DrawRect((i - 1) * 8, 0, 6, h)\n    end\nend\n```\nReason: `Color(...)` allocates/builds a color object each iteration; caching one immutable white color outside the paint loop removes that repeated work.","model_patch":"```lua\nlocal WHITE = Color(255, 255, 255)\n\nfunction PANEL:Paint(w, h)\n    surface.SetDrawColor(WHITE)\n\n    for i = 1, self.BarCount do\n        surface.DrawRect((i - 1) * 8, 0, 6, h)\n    end\nend\n```\nReason: `Color(...)` allocates/builds a color object each iteration; caching one immutable white color outside the paint loop removes that repeated work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-vs-global.v1","fixtureId":"gmod.perf.local-vs-global.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"c116d8c651190647","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5437,"startedAt":"2026-07-10T17:25:25.573Z","completedAt":"2026-07-10T17:25:31.013Z","answerBytes":213,"answerChars":213,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":54,"totalTokens":116,"source":"estimated"},"finalResponse":"```lua\nlocal sin = math.sin\n\nfor i = 1, 100000 do\n    local y = sin(i)\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table lookups (`math.sin`) inside the hot loop, which is slightly faster in Lua.","model_patch":"```lua\nlocal sin = math.sin\n\nfor i = 1, 100000 do\n    local y = sin(i)\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table lookups (`math.sin`) inside the hot loop, which is slightly faster in Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.localplayer-cache.v1","fixtureId":"gmod.perf.localplayer-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7398105af47b079e","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":14663,"startedAt":"2026-07-10T17:25:25.747Z","completedAt":"2026-07-10T17:25:40.411Z","answerBytes":684,"answerChars":684,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":171,"totalTokens":241,"source":"estimated"},"finalResponse":"```lua\nlocal LocalPlayer = LocalPlayer\nlocal IsValid = IsValid\n\nlocal cachedLocalPlayer\n\nlocal function LP()\n    if not IsValid(cachedLocalPlayer) then\n        cachedLocalPlayer = LocalPlayer()\n    end\n\n    return cachedLocalPlayer\nend\n\nhook.Add(\"HUDPaint\", \"ExampleCachedLocalPlayer\", function()\n    local ply = LP()\n    if not IsValid(ply) then return end\n\n    local health = ply:Health()\n    local armor = ply:Armor()\n    draw.SimpleText(health .. \" / \" .. armor, \"DermaDefault\", 16, 16, color_white)\nend)\n```\nReason: This caches both the global function lookup and the player entity, so repeated code uses a local reference and only refreshes it when the cached player is invalid.","model_patch":"```lua\nlocal LocalPlayer = LocalPlayer\nlocal IsValid = IsValid\n\nlocal cachedLocalPlayer\n\nlocal function LP()\n    if not IsValid(cachedLocalPlayer) then\n        cachedLocalPlayer = LocalPlayer()\n    end\n\n    return cachedLocalPlayer\nend\n\nhook.Add(\"HUDPaint\", \"ExampleCachedLocalPlayer\", function()\n    local ply = LP()\n    if not IsValid(ply) then return end\n\n    local health = ply:Health()\n    local armor = ply:Armor()\n    draw.SimpleText(health .. \" / \" .. armor, \"DermaDefault\", 16, 16, color_white)\nend)\n```\nReason: This caches both the global function lookup and the player entity, so repeated code uses a local reference and only refreshes it when the cached player is invalid."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.looking-at.v1","fixtureId":"gmod.perf.looking-at.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"20b22f678a4b08d7","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":17802,"startedAt":"2026-07-10T17:25:25.901Z","completedAt":"2026-07-10T17:25:43.704Z","answerBytes":493,"answerChars":493,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":91,"completionTokens":124,"totalTokens":215,"source":"estimated"},"finalResponse":"```lua\nlocal LOOK_DOT = 0.8 -- about 37 degrees of slack\n\nlocal function RoughlyLookingAtEachOther(plyA, plyB)\n    local toB = (plyB:EyePos() - plyA:EyePos()):GetNormalized()\n    local toA = -toB\n\n    return plyA:GetAimVector():Dot(toB) >= LOOK_DOT\n       and plyB:GetAimVector():Dot(toA) >= LOOK_DOT\nend\n```\nReason: Dot products avoid `math.acos`, so this stays cheap while still checking that each player's aim vector points toward the other player's eye position within a tunable threshold.","model_patch":"```lua\nlocal LOOK_DOT = 0.8 -- about 37 degrees of slack\n\nlocal function RoughlyLookingAtEachOther(plyA, plyB)\n    local toB = (plyB:EyePos() - plyA:EyePos()):GetNormalized()\n    local toA = -toB\n\n    return plyA:GetAimVector():Dot(toB) >= LOOK_DOT\n       and plyB:GetAimVector():Dot(toA) >= LOOK_DOT\nend\n```\nReason: Dot products avoid `math.acos`, so this stays cheap while still checking that each player's aim vector points toward the other player's eye position within a tunable threshold."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.meta-vs-arg.v1","fixtureId":"gmod.perf.meta-vs-arg.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de332f7356830dfa","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7569,"startedAt":"2026-07-10T17:25:26.193Z","completedAt":"2026-07-10T17:25:33.764Z","answerBytes":284,"answerChars":284,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":71,"totalTokens":142,"source":"estimated"},"finalResponse":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally the better choice for a helper you control because a local/direct function call avoids the per-call table method lookup behind `ply:SomeHelper()`, and `obj:method()` is mainly for real object methods, not free helpers.","model_patch":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally the better choice for a helper you control because a local/direct function call avoids the per-call table method lookup behind `ply:SomeHelper()`, and `obj:method()` is mainly for real object methods, not free helpers."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.msg-vs-print.v1","fixtureId":"gmod.perf.msg-vs-print.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"6cbb4e4b2f19dd24","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5478,"startedAt":"2026-07-10T17:25:26.472Z","completedAt":"2026-07-10T17:25:31.951Z","answerBytes":221,"answerChars":221,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":56,"totalTokens":119,"source":"estimated"},"finalResponse":"```lua\nMsgN(\"debug: hot path hit\")\n```\nReason: `MsgN` is typically faster than `print` in Garry's Mod for a simple debug line because it writes directly to the console without `print`'s extra argument formatting overhead.","model_patch":"```lua\nMsgN(\"debug: hot path hit\")\n```\nReason: `MsgN` is typically faster than `print` in Garry's Mod for a simple debug line because it writes directly to the console without `print`'s extra argument formatting overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.pairs-ipairs-for.v1","fixtureId":"gmod.perf.pairs-ipairs-for.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de5e4875fcf3e600","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7327,"startedAt":"2026-07-10T17:25:26.697Z","completedAt":"2026-07-10T17:25:34.026Z","answerBytes":293,"answerChars":293,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":74,"totalTokens":147,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, #numbers do\n    local value = numbers[i]\n    -- use value\nend\n```\nReason: `for i = 1, #numbers do` is the fastest typical choice for a large dense numeric array in Garry's Mod Lua because it avoids the iterator overhead of `pairs` and `ipairs` and does direct indexed access.","model_patch":"```lua\nfor i = 1, #numbers do\n    local value = numbers[i]\n    -- use value\nend\n```\nReason: `for i = 1, #numbers do` is the fastest typical choice for a large dense numeric array in Garry's Mod Lua because it avoids the iterator overhead of `pairs` and `ipairs` and does direct indexed access."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.plain-lua-vs-fn.v1","fixtureId":"gmod.perf.plain-lua-vs-fn.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ead0a98b3ff6a388","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16115,"startedAt":"2026-07-10T17:25:27.935Z","completedAt":"2026-07-10T17:25:44.051Z","answerBytes":653,"answerChars":653,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":164,"totalTokens":240,"source":"estimated"},"finalResponse":"```lua\n-- Equivalent to a filter->map pipeline, but done in one pass.\nlocal function collectPoliceNames(players)\n    local out = {}\n    local outN = 0\n\n    for i = 1, #players do\n        local ply = players[i]\n        if IsValid(ply) and ply:Alive() and ply:Team() == TEAM_POLICE then\n            outN = outN + 1\n            out[outN] = ply:Nick()\n        end\n    end\n\n    return out\nend\n\nlocal policeNames = collectPoliceNames(player.GetAll())\n```\nReason: A single indexed loop is usually faster than DarkRP's `fn` filter/map chain because it avoids extra closures, function-call overhead, and intermediate tables while doing the same work in one pass.","model_patch":"```lua\n-- Equivalent to a filter->map pipeline, but done in one pass.\nlocal function collectPoliceNames(players)\n    local out = {}\n    local outN = 0\n\n    for i = 1, #players do\n        local ply = players[i]\n        if IsValid(ply) and ply:Alive() and ply:Team() == TEAM_POLICE then\n            outN = outN + 1\n            out[outN] = ply:Nick()\n        end\n    end\n\n    return out\nend\n\nlocal policeNames = collectPoliceNames(player.GetAll())\n```\nReason: A single indexed loop is usually faster than DarkRP's `fn` filter/map chain because it avoids extra closures, function-call overhead, and intermediate tables while doing the same work in one pass."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.player-cache-hooks.v1","fixtureId":"gmod.perf.player-cache-hooks.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a834817afe9e6c25","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":9685,"startedAt":"2026-07-10T17:25:31.014Z","completedAt":"2026-07-10T17:25:40.701Z","answerBytes":658,"answerChars":658,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":88,"completionTokens":165,"totalTokens":253,"source":"estimated"},"finalResponse":"```lua\nlocal cachedPlayers = player.GetAll()\n\nlocal function RefreshPlayerCache()\n    cachedPlayers = player.GetAll()\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"MyAddon.RefreshPlayerCache\", RefreshPlayerCache)\nhook.Add(\"PlayerDisconnected\", \"MyAddon.RefreshPlayerCache\", RefreshPlayerCache)\n\nhook.Add(\"Tick\", \"MyAddon.DoPerPlayerWork\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n        if IsValid(ply) then\n            -- per-player work here\n        end\n    end\nend)\n```\nReason: `player.GetAll()` allocates/builds a fresh table, so caching it and only rebuilding on join/leave removes that per-tick work from `Tick`/`Think`.","model_patch":"```lua\nlocal cachedPlayers = player.GetAll()\n\nlocal function RefreshPlayerCache()\n    cachedPlayers = player.GetAll()\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"MyAddon.RefreshPlayerCache\", RefreshPlayerCache)\nhook.Add(\"PlayerDisconnected\", \"MyAddon.RefreshPlayerCache\", RefreshPlayerCache)\n\nhook.Add(\"Tick\", \"MyAddon.DoPerPlayerWork\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n        if IsValid(ply) then\n            -- per-player work here\n        end\n    end\nend)\n```\nReason: `player.GetAll()` allocates/builds a fresh table, so caching it and only rebuilding on join/leave removes that per-tick work from `Tick`/`Think`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ply-table-index.v1","fixtureId":"gmod.perf.ply-table-index.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f18cc80df8999147","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":12273,"startedAt":"2026-07-10T17:25:31.670Z","completedAt":"2026-07-10T17:25:43.945Z","answerBytes":483,"answerChars":483,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":69,"completionTokens":121,"totalTokens":190,"source":"estimated"},"finalResponse":"```lua\nlocal tempByEntIndex = {}\n\nlocal function SetTempData(ply, value)\n    tempByEntIndex[ply:EntIndex()] = value\nend\n\nlocal function GetTempData(ply)\n    return tempByEntIndex[ply:EntIndex()]\nend\n\nhook.Add(\"PlayerDisconnected\", \"ClearTempData\", function(ply)\n    tempByEntIndex[ply:EntIndex()] = nil\nend)\n```\nReason: A plain Lua table indexed by `EntIndex()` avoids per-read entity field/metatable lookup, so hot reads are cheaper; clearing on disconnect prevents slot reuse bugs.","model_patch":"```lua\nlocal tempByEntIndex = {}\n\nlocal function SetTempData(ply, value)\n    tempByEntIndex[ply:EntIndex()] = value\nend\n\nlocal function GetTempData(ply)\n    return tempByEntIndex[ply:EntIndex()]\nend\n\nhook.Add(\"PlayerDisconnected\", \"ClearTempData\", function(ply)\n    tempByEntIndex[ply:EntIndex()] = nil\nend)\n```\nReason: A plain Lua table indexed by `EntIndex()` avoids per-read entity field/metatable lookup, so hot reads are cheaper; clearing on disconnect prevents slot reuse bugs."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.seq-tables.v1","fixtureId":"gmod.perf.seq-tables.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4778b0220c3f91a3","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":8046,"startedAt":"2026-07-10T17:25:31.793Z","completedAt":"2026-07-10T17:25:39.842Z","answerBytes":331,"answerChars":331,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":83,"totalTokens":162,"source":"estimated"},"finalResponse":"```lua\nlocal values = {\n    \"alpha\",\n    \"beta\",\n    \"gamma\",\n    \"delta\",\n}\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n```\nReason: A sequential number-indexed array is faster to iterate than a string-keyed map because it uses dense integer keys and a simple numeric loop instead of hash-key traversal.","model_patch":"```lua\nlocal values = {\n    \"alpha\",\n    \"beta\",\n    \"gamma\",\n    \"delta\",\n}\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n```\nReason: A sequential number-indexed array is faster to iterate than a string-keyed map because it uses dense integer keys and a simple numeric loop instead of hash-key traversal."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.setdrawcolor-split.v1","fixtureId":"gmod.perf.setdrawcolor-split.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d110fde8a37bbe59","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6530,"startedAt":"2026-07-10T17:25:31.952Z","completedAt":"2026-07-10T17:25:38.484Z","answerBytes":202,"answerChars":202,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":51,"totalTokens":122,"source":"estimated"},"finalResponse":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Passing raw numbers is faster in a hot draw path because it avoids the extra Color/table argument handling that the `Color` overload requires.","model_patch":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Passing raw numbers is faster in a hot draw path because it avoids the extra Color/table argument handling that the `Color` overload requires."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.sqlite-vs-mysql.v1","fixtureId":"gmod.perf.sqlite-vs-mysql.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4a3f5d2a20d71ac9","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":8669,"startedAt":"2026-07-10T17:25:32.261Z","completedAt":"2026-07-10T17:25:40.932Z","answerBytes":296,"answerChars":296,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":100,"completionTokens":74,"totalTokens":174,"source":"estimated"},"finalResponse":"```lua\nlocal rows = sql.Query(\"SELECT coins FROM players WHERE steamid = \" .. sql.SQLStr(ply:SteamID64()))\n```\nReason: Local SQLite via Garry's Mod `sql` library is typically lower latency on a single server because it avoids network round trips and remote DB connection overhead that MySQL adds.","model_patch":"```lua\nlocal rows = sql.Query(\"SELECT coins FROM players WHERE steamid = \" .. sql.SQLStr(ply:SteamID64()))\n```\nReason: Local SQLite via Garry's Mod `sql` library is typically lower latency on a single server because it avoids network round trips and remote DB connection overhead that MySQL adds."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.steamid-cache.v1","fixtureId":"gmod.perf.steamid-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"e8a94aa454154982","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14965,"startedAt":"2026-07-10T17:25:32.460Z","completedAt":"2026-07-10T17:25:47.427Z","answerBytes":530,"answerChars":530,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":133,"totalTokens":196,"source":"estimated"},"finalResponse":"```lua\nlocal SID_CACHE_KEY = \"__cached_steamid\"\n\nlocal function GetSteamIDCached(ply)\n    local sid = ply[SID_CACHE_KEY]\n    if sid ~= nil then\n        return sid\n    end\n\n    sid = ply:SteamID()\n    ply[SID_CACHE_KEY] = sid\n    return sid\nend\n\n-- Hot path\nfor i = 1, #players do\n    local ply = players[i]\n    local steamID = GetSteamIDCached(ply)\n    -- use steamID\nend\n```\nReason: `ply:SteamID()` crosses into engine code each call, while a cached Lua field turns repeated lookups for the same player into a cheap table access.","model_patch":"```lua\nlocal SID_CACHE_KEY = \"__cached_steamid\"\n\nlocal function GetSteamIDCached(ply)\n    local sid = ply[SID_CACHE_KEY]\n    if sid ~= nil then\n        return sid\n    end\n\n    sid = ply:SteamID()\n    ply[SID_CACHE_KEY] = sid\n    return sid\nend\n\n-- Hot path\nfor i = 1, #players do\n    local ply = players[i]\n    local steamID = GetSteamIDCached(ply)\n    -- use steamID\nend\n```\nReason: `ply:SteamID()` crosses into engine code each call, while a cached Lua field turns repeated lookups for the same player into a cheap table access."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.string-table-concat.v1","fixtureId":"gmod.perf.string-table-concat.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b0cf9e04ae7c5dd9","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":6493,"startedAt":"2026-07-10T17:25:32.881Z","completedAt":"2026-07-10T17:25:39.376Z","answerBytes":416,"answerChars":416,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14894,"completionTokens":216,"totalTokens":15110,"reasoningTokens":76,"cachedTokens":14336},"finalResponse":"```lua\nlocal pieces = {}\n\nfor i = 1, 100000 do\n    pieces[i] = \"part\" .. i\nend\n\n-- Slow: repeated .. creates a new string every iteration.\nlocal slow = \"\"\nfor i = 1, #pieces do\n    slow = slow .. pieces[i]\nend\n\n-- Fast: collect pieces, then join once.\nlocal fast = table.concat(pieces)\n```\nReason: `table.concat` is faster because it avoids reallocating and copying the whole accumulated string on every `..` append.","model_patch":"```lua\nlocal pieces = {}\n\nfor i = 1, 100000 do\n    pieces[i] = \"part\" .. i\nend\n\n-- Slow: repeated .. creates a new string every iteration.\nlocal slow = \"\"\nfor i = 1, #pieces do\n    slow = slow .. pieces[i]\nend\n\n-- Fast: collect pieces, then join once.\nlocal fast = table.concat(pieces)\n```\nReason: `table.concat` is faster because it avoids reallocating and copying the whole accumulated string on every `..` append."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-drawrect.v1","fixtureId":"gmod.perf.surface-drawrect.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"696e8de769d9ad0e","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7067,"startedAt":"2026-07-10T17:25:33.765Z","completedAt":"2026-07-10T17:25:40.833Z","answerBytes":238,"answerChars":238,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":69,"completionTokens":60,"totalTokens":129,"source":"estimated"},"finalResponse":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` is a more direct rectangle draw path, while `draw.RoundedBox(0, ...)` adds wrapper overhead you do not need for non-rounded boxes.","model_patch":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` is a more direct rectangle draw path, while `draw.RoundedBox(0, ...)` adds wrapper overhead you do not need for non-rounded boxes."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-text.v1","fixtureId":"gmod.perf.surface-text.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"95d9fe4918ee4197","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":10952,"startedAt":"2026-07-10T17:25:34.027Z","completedAt":"2026-07-10T17:25:44.980Z","answerBytes":528,"answerChars":528,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":132,"totalTokens":208,"source":"estimated"},"finalResponse":"```lua\nlocal FONT = \"DermaDefaultBold\"\nlocal TEXT = \"FPS\"\nlocal X, Y = 24, 24\nlocal R, G, B, A = 255, 255, 255, 255\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    surface.SetFont(FONT)\n    surface.SetTextColor(R, G, B, A)\n    surface.SetTextPos(X, Y)\n    surface.DrawText(TEXT)\nend)\n```\nReason: `surface.SetFont` + `surface.SetTextPos` + `surface.DrawText` is the leanest path here for a single-line string; `draw.DrawText` does extra layout/alignment work and `draw.SimpleTextOutlined` adds multiple outline passes.","model_patch":"```lua\nlocal FONT = \"DermaDefaultBold\"\nlocal TEXT = \"FPS\"\nlocal X, Y = 24, 24\nlocal R, G, B, A = 255, 255, 255, 255\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    surface.SetFont(FONT)\n    surface.SetTextColor(R, G, B, A)\n    surface.SetTextPos(X, Y)\n    surface.DrawText(TEXT)\nend)\n```\nReason: `surface.SetFont` + `surface.SetTextPos` + `surface.DrawText` is the leanest path here for a single-line string; `draw.DrawText` does extra layout/alignment work and `draw.SimpleTextOutlined` adds multiple outline passes."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-count-hash.v1","fixtureId":"gmod.perf.table-count-hash.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3e9bbfc8452e05e3","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4863,"startedAt":"2026-07-10T17:25:36.509Z","completedAt":"2026-07-10T17:25:41.373Z","answerBytes":190,"answerChars":190,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":48,"totalTokens":110,"source":"estimated"},"finalResponse":"```lua\nlocal len = #myTable\n```\nReason: `#` is the preferred built-in length operator for sequential array-like tables; it is direct and avoids `table.Count`, which is for counting all keys.","model_patch":"```lua\nlocal len = #myTable\n```\nReason: `#` is the preferred built-in length operator for sequential array-like tables; it is direct and avoids `table.Count`, which is for counting all keys."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-empty.v1","fixtureId":"gmod.perf.table-empty.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3a6344977f5bd475","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7262,"startedAt":"2026-07-10T17:25:38.485Z","completedAt":"2026-07-10T17:25:45.748Z","answerBytes":239,"answerChars":239,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":60,"totalTokens":133,"source":"estimated"},"finalResponse":"```lua\nt = {}\n```\nReason: `t = {}` is generally faster because it allocates a new table instead of clearing every existing element one by one like `table.Empty(t)`, as long as you do not need to preserve other references to the same table.","model_patch":"```lua\nt = {}\n```\nReason: `t = {}` is generally faster because it allocates a new table instead of clearing every existing element one by one like `table.Empty(t)`, as long as you do not need to preserve other references to the same table."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-hasvalue.v1","fixtureId":"gmod.perf.table-hasvalue.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7d064428a873fdfc","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5560,"startedAt":"2026-07-10T17:25:39.154Z","completedAt":"2026-07-10T17:25:44.715Z","answerBytes":271,"answerChars":271,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":67,"completionTokens":68,"totalTokens":135,"source":"estimated"},"finalResponse":"```lua\nlocal allowed = {\n    pistol = true,\n    shotgun = true,\n    crowbar = true,\n}\n\nif allowed[className] then\n    -- value exists in the set\nend\n```\nReason: `table.HasValue` scans a list linearly, while a keyed lookup table gives near-constant-time membership checks.","model_patch":"```lua\nlocal allowed = {\n    pistol = true,\n    shotgun = true,\n    crowbar = true,\n}\n\nif allowed[className] then\n    -- value exists in the set\nend\n```\nReason: `table.HasValue` scans a list linearly, while a keyed lookup table gives near-constant-time membership checks."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-literal.v1","fixtureId":"gmod.perf.table-literal.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f95a8fc610d720ad","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7375,"startedAt":"2026-07-10T17:25:39.377Z","completedAt":"2026-07-10T17:25:46.753Z","answerBytes":297,"answerChars":297,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":75,"totalTokens":145,"source":"estimated"},"finalResponse":"```lua\n-- Faster\nlocal t = {\n    a = 1,\n    b = 2,\n    c = 3,\n}\n\n-- Slower\n-- local t = {}\n-- t.a = 1\n-- t.b = 2\n-- t.c = 3\n```\nReason: For a small table with known keys, the table constructor does the work in one allocation/initialization step and avoids separate field-set operations after `{}`.","model_patch":"```lua\n-- Faster\nlocal t = {\n    a = 1,\n    b = 2,\n    c = 3,\n}\n\n-- Slower\n-- local t = {}\n-- t.a = 1\n-- t.b = 2\n-- t.c = 3\n```\nReason: For a small table with known keys, the table constructor does the work in one allocation/initialization step and avoids separate field-set operations after `{}`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-random.v1","fixtureId":"gmod.perf.table-random.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f3e090701953d4a9","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7403,"startedAt":"2026-07-10T17:25:39.843Z","completedAt":"2026-07-10T17:25:47.247Z","answerBytes":285,"answerChars":285,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":72,"totalTokens":138,"source":"estimated"},"finalResponse":"```lua\nlocal function randomSequential(t)\n    return t[math.random(#t)]\nend\n\nlocal value = randomSequential(mySequentialTable)\n```\nReason: For a dense 1..n array, direct indexing with `math.random(#t)` avoids the extra generic work `table.Random` does to support non-sequential tables.","model_patch":"```lua\nlocal function randomSequential(t)\n    return t[math.random(#t)]\nend\n\nlocal value = randomSequential(mySequentialTable)\n```\nReason: For a dense 1..n array, direct indexing with `math.random(#t)` avoids the extra generic work `table.Random` does to support non-sequential tables."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.x-times-x.v1","fixtureId":"gmod.perf.x-times-x.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"79d48008f6b5174f","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4487,"startedAt":"2026-07-10T17:25:40.039Z","completedAt":"2026-07-10T17:25:44.528Z","answerBytes":161,"answerChars":161,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":58,"completionTokens":41,"totalTokens":99,"source":"estimated"},"finalResponse":"```lua\nlocal squared = x * x\n```\nReason: `x * x` is the preferred fast form in a tight loop because it avoids function-call overhead and exponentiation dispatch.","model_patch":"```lua\nlocal squared = x * x\n```\nReason: `x * x` is the preferred fast form in a tight loop because it avoids function-call overhead and exponentiation dispatch."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.player-iterator.v1","fixtureId":"gmod.player-iterator.v1","fixtureVersion":2,"rubricVersion":"4","promptHash":"fe3d7469535a0ca2","adapterId":"codex","model":"gpt-5.4@high","model_name_or_path":"gpt-5.4@high","attemptIndex":1,"status":"pass","detail":"Uses player.Iterator() (wiki-recommended Lua-cached iterator).","durationMs":10619,"startedAt":"2026-07-10T17:25:40.143Z","completedAt":"2026-07-10T17:25:50.764Z","answerBytes":189,"answerChars":189,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":80,"completionTokens":48,"totalTokens":128,"source":"estimated"},"finalResponse":"```lua\nfor _, ply in player.Iterator() do\n    -- ...\nend\n```\nReason: `player.Iterator()` visits every connected player without allocating the temporary table that `player.GetAll()` creates.","model_patch":"```lua\nfor _, ply in player.Iterator() do\n    -- ...\nend\n```\nReason: `player.Iterator()` visits every connected player without allocating the temporary table that `player.GetAll()` creates."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.ents-iterator.v1","fixtureId":"gmod.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"3990c92253db85bb","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13332,"startedAt":"2026-07-10T17:25:40.412Z","completedAt":"2026-07-10T17:25:53.746Z","answerBytes":263,"answerChars":263,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":72,"completionTokens":66,"totalTokens":138,"source":"estimated"},"finalResponse":"```lua\nfor _, ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- do something with ent\n    end\nend\n```\nReason: `ents.Iterator()` streams entities one by one, so it avoids allocating a table of all entities before filtering by class.","model_patch":"```lua\nfor _, ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- do something with ent\n    end\nend\n```\nReason: `ents.Iterator()` streams entities one by one, so it avoids allocating a table of all entities before filtering by class."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.hook-add.v1","fixtureId":"gmod.hook-add.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"12d2222fdb7d6b90","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Registers a named hook with hook.Add.","durationMs":5455,"startedAt":"2026-07-10T17:25:40.702Z","completedAt":"2026-07-10T17:25:46.158Z","answerBytes":218,"answerChars":218,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":78,"completionTokens":55,"totalTokens":133,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- Think callback\nend)\n```\nReason: `hook.Add` registers a function on Garry's Mod's `Think` hook, and `MyAddon.Think` is the unique identifier for this callback.","model_patch":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- Think callback\nend)\n```\nReason: `hook.Add` registers a function on Garry's Mod's `Think` hook, and `MyAddon.Think` is the unique identifier for this callback."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.isvalid.v1","fixtureId":"gmod.isvalid.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"35527312e59dfc13","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Uses IsValid for entity/object validity.","durationMs":6804,"startedAt":"2026-07-10T17:25:40.834Z","completedAt":"2026-07-10T17:25:47.640Z","answerBytes":241,"answerChars":241,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":74,"completionTokens":61,"totalTokens":135,"source":"estimated"},"finalResponse":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: `IsValid(ent)` is the standard Garry's Mod guard and returns false for `nil`, `NULL`, and removed/invalid entities, so method calls only run when the reference is still usable.","model_patch":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: `IsValid(ent)` is the standard Garry's Mod guard and returns false for `nil`, `NULL`, and removed/invalid entities, so method calls only run when the reference is still usable."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.net-receivers.v1","fixtureId":"gmod.net-receivers.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"24d54ee8366753a6","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11476,"startedAt":"2026-07-10T17:25:40.933Z","completedAt":"2026-07-10T17:25:52.410Z","answerBytes":218,"answerChars":218,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":64,"completionTokens":55,"totalTokens":119,"source":"estimated"},"finalResponse":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- Handle the incoming MyAddon.Sync message here.\nend)\n```\nReason: `net.Receive` registers a callback that runs whenever the `MyAddon.Sync` net message arrives.","model_patch":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- Handle the incoming MyAddon.Sync message here.\nend)\n```\nReason: `net.Receive` registers a callback that runs whenever the `MyAddon.Sync` net message arrives."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.angle-zero.v1","fixtureId":"gmod.perf.angle-zero.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f6bc97bf98280d62","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":14208,"startedAt":"2026-07-10T17:25:41.374Z","completedAt":"2026-07-10T17:25:55.584Z","answerBytes":437,"answerChars":437,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":110,"totalTokens":181,"source":"estimated"},"finalResponse":"```lua\n-- Slow: allocates a new Angle every call.\nlocal function slow()\n    return Angle()\nend\n\n-- Fast: reuse one scratch Angle and zero it in place.\nlocal scratchAng = Angle()\n\nlocal function fast()\n    scratchAng:SetUnpacked(0, 0, 0)\n    return scratchAng\nend\n```\nReason: Reusing one `Angle` avoids per-call allocation and GC churn; zeroing the same object in place is cheaper than constructing a new `Angle()` on every hot-path call.","model_patch":"```lua\n-- Slow: allocates a new Angle every call.\nlocal function slow()\n    return Angle()\nend\n\n-- Fast: reuse one scratch Angle and zero it in place.\nlocal scratchAng = Angle()\n\nlocal function fast()\n    scratchAng:SetUnpacked(0, 0, 0)\n    return scratchAng\nend\n```\nReason: Reusing one `Angle` avoids per-call allocation and GC churn; zeroing the same object in place is cheaper than constructing a new `Angle()` on every hot-path call."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.config-var.v1","fixtureId":"gmod.perf.config-var.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"bcc4ff8eb162b699","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"incorrect","detail":"Matched an incorrect-answer pattern.","durationMs":10014,"startedAt":"2026-07-10T17:25:42.747Z","completedAt":"2026-07-10T17:25:52.762Z","answerBytes":212,"answerChars":212,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":82,"completionTokens":53,"totalTokens":135,"source":"estimated"},"finalResponse":"```lua\nlocal addonColor = myaddon.config.color\nlocal color = addonColor\n```\nReason: A local is fastest in Lua; `myaddon.config.color` does multiple table lookups, and a global is also a table lookup through `_G`.","model_patch":"```lua\nlocal addonColor = myaddon.config.color\nlocal color = addonColor\n```\nReason: A local is fastest in Lua; `myaddon.config.color` does multiple table lookups, and a global is also a table lookup through `_G`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.darkrpvar.v1","fixtureId":"gmod.perf.darkrpvar.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"02a37daa699cded3","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":57488,"startedAt":"2026-07-10T17:25:43.705Z","completedAt":"2026-07-10T17:26:41.194Z","answerBytes":214,"answerChars":214,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":54,"totalTokens":120,"source":"estimated"},"finalResponse":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\") -- preferred over ply:GetNWString(\"job\")\n```\nReason: `job` is a DarkRPVar, so `getDarkRPVar` is the supported DarkRP API and does not depend on generic NWString state.","model_patch":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\") -- preferred over ply:GetNWString(\"job\")\n```\nReason: `job` is a DarkRPVar, so `getDarkRPVar` is the supported DarkRP API and does not depend on generic NWString state."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.disttosqr.v1","fixtureId":"gmod.perf.disttosqr.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a5772470c6859cdc","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":8164,"startedAt":"2026-07-10T17:25:43.946Z","completedAt":"2026-07-10T17:25:52.111Z","answerBytes":295,"answerChars":295,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":74,"totalTokens":145,"source":"estimated"},"finalResponse":"```lua\nlocal maxDist = 256\n\nif vec1:DistToSqr(vec2) <= maxDist * maxDist then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root used by actual distance calculation, so it is the preferred and faster method for threshold checks when you compare against the squared threshold.","model_patch":"```lua\nlocal maxDist = 256\n\nif vec1:DistToSqr(vec2) <= maxDist * maxDist then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root used by actual distance calculation, so it is the preferred and faster method for threshold checks when you compare against the squared threshold."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ents-iterator.v1","fixtureId":"gmod.perf.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"306d3f1d05f28246","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":29364,"startedAt":"2026-07-10T17:25:44.052Z","completedAt":"2026-07-10T17:26:13.417Z","answerBytes":339,"answerChars":339,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":85,"totalTokens":151,"source":"estimated"},"finalResponse":"```lua\nfor _, ent in ents.Iterator() do\n    -- Visit every entity here.\nend\n```\nReason: `ents.Iterator()` is the wiki-recommended efficient full-entity iterator because it walks the engine list directly without allocating the temporary table that `ents.GetAll()` creates; use `ents.GetAll()` only if you specifically need a snapshot table.","model_patch":"```lua\nfor _, ent in ents.Iterator() do\n    -- Visit every entity here.\nend\n```\nReason: `ents.Iterator()` is the wiki-recommended efficient full-entity iterator because it walks the engine list directly without allocating the temporary table that `ents.GetAll()` creates; use `ents.GetAll()` only if you specifically need a snapshot table."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-ents-near.v1","fixtureId":"gmod.perf.find-ents-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"07c583fc3d9fe09f","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":11723,"startedAt":"2026-07-10T17:25:44.529Z","completedAt":"2026-07-10T17:25:56.254Z","answerBytes":567,"answerChars":567,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14914,"completionTokens":506,"totalTokens":15420,"reasoningTokens":332,"cachedTokens":14336},"finalResponse":"```lua\nlocal radius = 512\nlocal nearby = ents.FindInSphere(ply:GetPos(), radius)\n\nfor i = #nearby, 1, -1 do\n    local ent = nearby[i]\n    if not IsValid(ent) or ent == ply then\n        nearby[i] = nearby[#nearby]\n        nearby[#nearby] = nil\n    end\nend\n\n-- `nearby` now contains valid entities near the player.\n```\nReason: `ents.FindInSphere` is one of the commonly faster built-in `FindIn*` choices for a cheap near-player query because it stays engine-side, uses spatial partitioning, and matches a radius lookup directly without `FindInPVS` visibility semantics.","model_patch":"```lua\nlocal radius = 512\nlocal nearby = ents.FindInSphere(ply:GetPos(), radius)\n\nfor i = #nearby, 1, -1 do\n    local ent = nearby[i]\n    if not IsValid(ent) or ent == ply then\n        nearby[i] = nearby[#nearby]\n        nearby[#nearby] = nil\n    end\nend\n\n-- `nearby` now contains valid entities near the player.\n```\nReason: `ents.FindInSphere` is one of the commonly faster built-in `FindIn*` choices for a cheap near-player query because it stays engine-side, uses spatial partitioning, and matches a radius lookup directly without `FindInPVS` visibility semantics."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-players-near.v1","fixtureId":"gmod.perf.find-players-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d139ba2e8ee38a2f","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":46343,"startedAt":"2026-07-10T17:25:44.716Z","completedAt":"2026-07-10T17:26:31.061Z","answerBytes":543,"answerChars":543,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":136,"totalTokens":215,"source":"estimated"},"finalResponse":"```lua\nlocal player_GetAll = player.GetAll\n\nlocal function FindPlayersNear(pos, radius)\n    local radiusSqr = radius * radius\n    local players = player_GetAll()\n    local out, n = {}, 0\n\n    for i = 1, #players do\n        local ply = players[i]\n        if ply:GetPos():DistToSqr(pos) <= radiusSqr then\n            n = n + 1\n            out[n] = ply\n        end\n    end\n\n    return out\nend\n```\nReason: This scans only players instead of all entities, avoids per-entity class checks, and uses squared distance to skip the expensive square root.","model_patch":"```lua\nlocal player_GetAll = player.GetAll\n\nlocal function FindPlayersNear(pos, radius)\n    local radiusSqr = radius * radius\n    local players = player_GetAll()\n    local out, n = {}, 0\n\n    for i = 1, #players do\n        local ply = players[i]\n        if ply:GetPos():DistToSqr(pos) <= radiusSqr then\n            n = n + 1\n            out[n] = ply\n        end\n    end\n\n    return out\nend\n```\nReason: This scans only players instead of all entities, avoids per-entity class checks, and uses squared distance to skip the expensive square root."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.for-vs-while.v1","fixtureId":"gmod.perf.for-vs-while.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b3401a190a8aecf0","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":9279,"startedAt":"2026-07-10T17:25:44.981Z","completedAt":"2026-07-10T17:25:54.261Z","answerBytes":255,"answerChars":255,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":65,"completionTokens":64,"totalTokens":129,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, n do\n    -- work\nend\n```\nReason: Numeric `for` is generally faster for 1..n counting in Garry's Mod Lua because it uses the language's built-in counted-loop path and avoids the extra manual condition and increment work of a `while` loop.","model_patch":"```lua\nfor i = 1, n do\n    -- work\nend\n```\nReason: Numeric `for` is generally faster for 1..n counting in Garry's Mod Lua because it uses the language's built-in counted-loop path and avoids the extra manual condition and increment work of a `while` loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hook-once.v1","fixtureId":"gmod.perf.hook-once.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ed1d3e09249fc8bb","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14651,"startedAt":"2026-07-10T17:25:45.160Z","completedAt":"2026-07-10T17:25:59.813Z","answerBytes":766,"answerChars":766,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":84,"completionTokens":192,"totalTokens":276,"source":"estimated"},"finalResponse":"```lua\n-- Faster: one hook dispatch per tick, then iterate players inside the listener.\nhook.Add(\"Tick\", \"NotifyAllPlayersOnce\", function()\n    hook.Run(\"MyPerTickPlayers\", player.GetAll())\nend)\n\nhook.Add(\"MyPerTickPlayers\", \"HandlePlayers\", function(players)\n    for i = 1, #players do\n        local ply = players[i]\n        -- custom per-player logic here\n    end\nend)\n\n-- Slower:\n-- hook.Add(\"Tick\", \"NotifyEachPlayerSeparately\", function()\n--     local players = player.GetAll()\n--     for i = 1, #players do\n--         hook.Run(\"MyPerTickPlayer\", players[i])\n--     end\n-- end)\n```\nReason: `hook.Run` has dispatch overhead, so calling it once per tick and looping players inside the handler does less total work than re-entering the hook system once per player.","model_patch":"```lua\n-- Faster: one hook dispatch per tick, then iterate players inside the listener.\nhook.Add(\"Tick\", \"NotifyAllPlayersOnce\", function()\n    hook.Run(\"MyPerTickPlayers\", player.GetAll())\nend)\n\nhook.Add(\"MyPerTickPlayers\", \"HandlePlayers\", function(players)\n    for i = 1, #players do\n        local ply = players[i]\n        -- custom per-player logic here\n    end\nend)\n\n-- Slower:\n-- hook.Add(\"Tick\", \"NotifyEachPlayerSeparately\", function()\n--     local players = player.GetAll()\n--     for i = 1, #players do\n--         hook.Run(\"MyPerTickPlayer\", players[i])\n--     end\n-- end)\n```\nReason: `hook.Run` has dispatch overhead, so calling it once per tick and looping players inside the handler does less total work than re-entering the hook system once per player."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hudpaint-cache.v1","fixtureId":"gmod.perf.hudpaint-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3def450f3158ceff","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":15524,"startedAt":"2026-07-10T17:25:45.748Z","completedAt":"2026-07-10T17:26:01.274Z","answerBytes":631,"answerChars":631,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":158,"totalTokens":234,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"HUDPaint\", \"DrawHealth\", function()\n    local ply = LocalPlayer()\n    if not IsValid(ply) then return end\n\n    local health = ply:Health()\n    local healthText = tostring(health)\n\n    draw.RoundedBox(4, 20, 20, health * 2, 24, Color(200, 60, 60))\n    draw.SimpleText(healthText, \"Trebuchet24\", 28, 22, color_white)\n    draw.SimpleTextOutlined(healthText, \"Trebuchet24\", 28, 22, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP, 1, color_black)\nend)\n```\nReason: Cache `LocalPlayer():Health()` once per `HUDPaint` so the three draw calls reuse one value instead of repeating the method lookup and call in the same frame.","model_patch":"```lua\nhook.Add(\"HUDPaint\", \"DrawHealth\", function()\n    local ply = LocalPlayer()\n    if not IsValid(ply) then return end\n\n    local health = ply:Health()\n    local healthText = tostring(health)\n\n    draw.RoundedBox(4, 20, 20, health * 2, 24, Color(200, 60, 60))\n    draw.SimpleText(healthText, \"Trebuchet24\", 28, 22, color_white)\n    draw.SimpleTextOutlined(healthText, \"Trebuchet24\", 28, 22, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP, 1, color_black)\nend)\n```\nReason: Cache `LocalPlayer():Health()` once per `HUDPaint` so the three draw calls reuse one value instead of repeating the method lookup and call in the same frame."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-color.v1","fixtureId":"gmod.perf.local-color.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"16a7bed1b931d467","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16287,"startedAt":"2026-07-10T17:25:45.967Z","completedAt":"2026-07-10T17:26:02.255Z","answerBytes":327,"answerChars":327,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14890,"completionTokens":358,"totalTokens":15248,"reasoningTokens":235,"cachedTokens":14336},"finalResponse":"```lua\nlocal WHITE = Color(255, 255, 255)\n\nfunction PANEL:Paint(w, h)\n    for i = 1, 100 do\n        surface.SetDrawColor(WHITE)\n        surface.DrawRect(0, i * 4, w, 2)\n    end\nend\n```\nReason: `Color(255, 255, 255)` creates a new color object each iteration; reusing one cached color removes per-frame allocations and GC churn.","model_patch":"```lua\nlocal WHITE = Color(255, 255, 255)\n\nfunction PANEL:Paint(w, h)\n    for i = 1, 100 do\n        surface.SetDrawColor(WHITE)\n        surface.DrawRect(0, i * 4, w, 2)\n    end\nend\n```\nReason: `Color(255, 255, 255)` creates a new color object each iteration; reusing one cached color removes per-frame allocations and GC churn."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-vs-global.v1","fixtureId":"gmod.perf.local-vs-global.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"c116d8c651190647","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13584,"startedAt":"2026-07-10T17:25:46.159Z","completedAt":"2026-07-10T17:25:59.745Z","answerBytes":248,"answerChars":248,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14894,"completionTokens":217,"totalTokens":15111,"reasoningTokens":127,"cachedTokens":14336},"finalResponse":"```lua\nlocal sin = math.sin\n\nfor i = 1, 1000000 do\n    local y = sin(i)\n    -- hot-loop work\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table/global lookups inside the hot loop, which is a small but common Lua micro-optimization.","model_patch":"```lua\nlocal sin = math.sin\n\nfor i = 1, 1000000 do\n    local y = sin(i)\n    -- hot-loop work\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table/global lookups inside the hot loop, which is a small but common Lua micro-optimization."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.localplayer-cache.v1","fixtureId":"gmod.perf.localplayer-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7398105af47b079e","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":22563,"startedAt":"2026-07-10T17:25:46.754Z","completedAt":"2026-07-10T17:26:09.319Z","answerBytes":659,"answerChars":659,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14897,"completionTokens":684,"totalTokens":15581,"reasoningTokens":503,"cachedTokens":14336},"finalResponse":"```lua\nlocal getLocalPlayer = LocalPlayer\nlocal cachedLocalPlayer\n\nlocal function LP()\n    local ply = cachedLocalPlayer\n    if not IsValid(ply) then\n        ply = getLocalPlayer()\n        if not IsValid(ply) then return nil end\n        cachedLocalPlayer = ply\n    end\n    return ply\nend\n\nhook.Add(\"Think\", \"HotPathExample\", function()\n    local ply = LP()\n    if not ply then return end\n\n    if ply:Alive() then\n        -- use ply here instead of calling LocalPlayer() again\n    end\nend)\n```\nReason: It avoids repeated global/function lookup and player resolution on hot paths by caching the local player and only refreshing when that entity becomes invalid.","model_patch":"```lua\nlocal getLocalPlayer = LocalPlayer\nlocal cachedLocalPlayer\n\nlocal function LP()\n    local ply = cachedLocalPlayer\n    if not IsValid(ply) then\n        ply = getLocalPlayer()\n        if not IsValid(ply) then return nil end\n        cachedLocalPlayer = ply\n    end\n    return ply\nend\n\nhook.Add(\"Think\", \"HotPathExample\", function()\n    local ply = LP()\n    if not ply then return end\n\n    if ply:Alive() then\n        -- use ply here instead of calling LocalPlayer() again\n    end\nend)\n```\nReason: It avoids repeated global/function lookup and player resolution on hot paths by caching the local player and only refreshing when that entity becomes invalid."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.looking-at.v1","fixtureId":"gmod.perf.looking-at.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"20b22f678a4b08d7","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":21925,"startedAt":"2026-07-10T17:25:47.248Z","completedAt":"2026-07-10T17:26:09.175Z","answerBytes":499,"answerChars":499,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14909,"completionTokens":673,"totalTokens":15582,"reasoningTokens":516,"cachedTokens":14336},"finalResponse":"```lua\nlocal function RoughlyLookingAtEachOther(a, b, dotThreshold)\n    dotThreshold = dotThreshold or 0.8 -- higher = stricter\n\n    local aToB = (b:EyePos() - a:EyePos()):GetNormalized()\n    local bToA = -aToB\n\n    return a:GetAimVector():Dot(aToB) >= dotThreshold\n       and b:GetAimVector():Dot(bToA) >= dotThreshold\nend\n```\nReason: Dot products avoid `math.acos`, so this stays fast and directly checks whether each player's aim vector points close enough toward the other player's eye position.","model_patch":"```lua\nlocal function RoughlyLookingAtEachOther(a, b, dotThreshold)\n    dotThreshold = dotThreshold or 0.8 -- higher = stricter\n\n    local aToB = (b:EyePos() - a:EyePos()):GetNormalized()\n    local bToA = -aToB\n\n    return a:GetAimVector():Dot(aToB) >= dotThreshold\n       and b:GetAimVector():Dot(bToA) >= dotThreshold\nend\n```\nReason: Dot products avoid `math.acos`, so this stays fast and directly checks whether each player's aim vector points close enough toward the other player's eye position."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.meta-vs-arg.v1","fixtureId":"gmod.perf.meta-vs-arg.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de332f7356830dfa","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":17635,"startedAt":"2026-07-10T17:25:47.428Z","completedAt":"2026-07-10T17:26:05.064Z","answerBytes":267,"answerChars":267,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14901,"completionTokens":411,"totalTokens":15312,"reasoningTokens":332,"cachedTokens":0},"finalResponse":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally faster for a helper you control because it can be a direct function call and avoids the extra table/metatable method lookup behind `ply:SomeHelper()`, though the gap is usually small outside hot paths.","model_patch":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally faster for a helper you control because it can be a direct function call and avoids the extra table/metatable method lookup behind `ply:SomeHelper()`, though the gap is usually small outside hot paths."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.msg-vs-print.v1","fixtureId":"gmod.perf.msg-vs-print.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"6cbb4e4b2f19dd24","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":23345,"startedAt":"2026-07-10T17:25:47.640Z","completedAt":"2026-07-10T17:26:10.986Z","answerBytes":187,"answerChars":187,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14894,"completionTokens":583,"totalTokens":15477,"reasoningTokens":516,"cachedTokens":14336},"finalResponse":"```lua\nMsgN(\"[debug] hot path hit\")\n```\nReason: `MsgN` is faster than `print` in Garry's Mod because it writes directly to the console with less argument-handling and formatting overhead.","model_patch":"```lua\nMsgN(\"[debug] hot path hit\")\n```\nReason: `MsgN` is faster than `print` in Garry's Mod because it writes directly to the console with less argument-handling and formatting overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.pairs-ipairs-for.v1","fixtureId":"gmod.perf.pairs-ipairs-for.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de5e4875fcf3e600","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16629,"startedAt":"2026-07-10T17:25:50.765Z","completedAt":"2026-07-10T17:26:07.395Z","answerBytes":321,"answerChars":321,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14902,"completionTokens":375,"totalTokens":15277,"reasoningTokens":277,"cachedTokens":14336},"finalResponse":"```lua\nlocal nums = someSequentialNumberTable\n\nfor i = 1, #nums do\n    local v = nums[i]\n    -- use v\nend\n```\nReason: `numeric for` avoids iterator overhead and direct integer indexing is typically faster than `ipairs`, while `pairs` is for generic table traversal and is usually the slowest for a dense sequential array.","model_patch":"```lua\nlocal nums = someSequentialNumberTable\n\nfor i = 1, #nums do\n    local v = nums[i]\n    -- use v\nend\n```\nReason: `numeric for` avoids iterator overhead and direct integer indexing is typically faster than `ipairs`, while `pairs` is for generic table traversal and is usually the slowest for a dense sequential array."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.plain-lua-vs-fn.v1","fixtureId":"gmod.perf.plain-lua-vs-fn.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ead0a98b3ff6a388","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":44243,"startedAt":"2026-07-10T17:25:52.112Z","completedAt":"2026-07-10T17:26:36.357Z","answerBytes":540,"answerChars":540,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14916,"completionTokens":1854,"totalTokens":16770,"reasoningTokens":1683,"cachedTokens":14336},"finalResponse":"```lua\nlocal IsValid = IsValid\n\nlocal function getPoliceNames(players)\n    local out = {}\n    local n = 0\n\n    for i = 1, #players do\n        local ply = players[i]\n\n        if IsValid(ply) and ply:Alive() and ply:isCP() then\n            n = n + 1\n            out[n] = ply:Nick()\n        end\n    end\n\n    return out\nend\n\nlocal policeNames = getPoliceNames(player.GetAll())\n```\nReason: A single indexed loop fuses filter and map into one pass, avoids fn closure/combinator overhead and intermediate tables, and is usually faster in GMod Lua.","model_patch":"```lua\nlocal IsValid = IsValid\n\nlocal function getPoliceNames(players)\n    local out = {}\n    local n = 0\n\n    for i = 1, #players do\n        local ply = players[i]\n\n        if IsValid(ply) and ply:Alive() and ply:isCP() then\n            n = n + 1\n            out[n] = ply:Nick()\n        end\n    end\n\n    return out\nend\n\nlocal policeNames = getPoliceNames(player.GetAll())\n```\nReason: A single indexed loop fuses filter and map into one pass, avoids fn closure/combinator overhead and intermediate tables, and is usually faster in GMod Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.player-cache-hooks.v1","fixtureId":"gmod.perf.player-cache-hooks.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a834817afe9e6c25","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":69771,"startedAt":"2026-07-10T17:25:52.411Z","completedAt":"2026-07-10T17:27:02.183Z","answerBytes":769,"answerChars":769,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14911,"completionTokens":3300,"totalTokens":18211,"reasoningTokens":3069,"cachedTokens":14336},"finalResponse":"```lua\nlocal cachedPlayers = player.GetAll()\n\nhook.Add(\"PlayerInitialSpawn\", \"MyPlayerCacheAdd\", function(ply)\n    cachedPlayers[#cachedPlayers + 1] = ply\nend)\n\nhook.Add(\"PlayerDisconnected\", \"MyPlayerCacheRemove\", function(ply)\n    for i = 1, #cachedPlayers do\n        if cachedPlayers[i] == ply then\n            table.remove(cachedPlayers, i)\n            break\n        end\n    end\nend)\n\nhook.Add(\"Tick\", \"MyHotPlayerLoop\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n\n        -- per-player work here\n        -- Example: if ply:Alive() then ... end\n    end\nend)\n```\nReason: `player.GetAll()` creates/traverses a player list every call, so moving that work to join/leave hooks keeps the hot `Tick` loop to a cheap cached-table scan.","model_patch":"```lua\nlocal cachedPlayers = player.GetAll()\n\nhook.Add(\"PlayerInitialSpawn\", \"MyPlayerCacheAdd\", function(ply)\n    cachedPlayers[#cachedPlayers + 1] = ply\nend)\n\nhook.Add(\"PlayerDisconnected\", \"MyPlayerCacheRemove\", function(ply)\n    for i = 1, #cachedPlayers do\n        if cachedPlayers[i] == ply then\n            table.remove(cachedPlayers, i)\n            break\n        end\n    end\nend)\n\nhook.Add(\"Tick\", \"MyHotPlayerLoop\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n\n        -- per-player work here\n        -- Example: if ply:Alive() then ... end\n    end\nend)\n```\nReason: `player.GetAll()` creates/traverses a player list every call, so moving that work to join/leave hooks keeps the hot `Tick` loop to a cheap cached-table scan."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ply-table-index.v1","fixtureId":"gmod.perf.ply-table-index.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f18cc80df8999147","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":40869,"startedAt":"2026-07-10T17:25:52.763Z","completedAt":"2026-07-10T17:26:33.633Z","answerBytes":566,"answerChars":566,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14896,"completionTokens":1708,"totalTokens":16604,"reasoningTokens":1524,"cachedTokens":14336},"finalResponse":"```lua\nlocal tempByPlayerId = {}\n\nlocal function SetTemp(ply, value)\n    tempByPlayerId[ply:EntIndex()] = value\nend\n\nlocal function GetTemp(ply)\n    return tempByPlayerId[ply:EntIndex()]\nend\n\nhook.Add(\"PlayerDisconnected\", \"ClearTempByPlayerId\", function(ply)\n    tempByPlayerId[ply:EntIndex()] = nil\nend)\n\n-- hot read path\nlocal id = ply:EntIndex()\nlocal value = tempByPlayerId[id]\n```\nReason: A plain Lua table indexed by `EntIndex()` avoids Garry's Mod entity field/metatable lookup on each read, so hot temporary per-player reads are faster than `ply.someField`.","model_patch":"```lua\nlocal tempByPlayerId = {}\n\nlocal function SetTemp(ply, value)\n    tempByPlayerId[ply:EntIndex()] = value\nend\n\nlocal function GetTemp(ply)\n    return tempByPlayerId[ply:EntIndex()]\nend\n\nhook.Add(\"PlayerDisconnected\", \"ClearTempByPlayerId\", function(ply)\n    tempByPlayerId[ply:EntIndex()] = nil\nend)\n\n-- hot read path\nlocal id = ply:EntIndex()\nlocal value = tempByPlayerId[id]\n```\nReason: A plain Lua table indexed by `EntIndex()` avoids Garry's Mod entity field/metatable lookup on each read, so hot temporary per-player reads are faster than `ply.someField`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.seq-tables.v1","fixtureId":"gmod.perf.seq-tables.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4778b0220c3f91a3","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":19368,"startedAt":"2026-07-10T17:25:53.746Z","completedAt":"2026-07-10T17:26:13.115Z","answerBytes":311,"answerChars":311,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14899,"completionTokens":529,"totalTokens":15428,"reasoningTokens":419,"cachedTokens":14336},"finalResponse":"```lua\nlocal values = {\n    \"alpha\",\n    \"beta\",\n    \"gamma\",\n    \"delta\",\n}\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n```\nReason: Sequential number-indexed arrays use Lua's array part and a numeric `for` loop, which iterates faster than traversing string-keyed maps with `pairs`. ","model_patch":"```lua\nlocal values = {\n    \"alpha\",\n    \"beta\",\n    \"gamma\",\n    \"delta\",\n}\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n```\nReason: Sequential number-indexed arrays use Lua's array part and a numeric `for` loop, which iterates faster than traversing string-keyed maps with `pairs`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.setdrawcolor-split.v1","fixtureId":"gmod.perf.setdrawcolor-split.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d110fde8a37bbe59","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":19028,"startedAt":"2026-07-10T17:25:54.262Z","completedAt":"2026-07-10T17:26:13.291Z","answerBytes":338,"answerChars":338,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14902,"completionTokens":497,"totalTokens":15399,"reasoningTokens":373,"cachedTokens":14336},"finalResponse":"```lua\nlocal r, g, b, a = 255, 120, 40, 255\n\nhook.Add(\"HUDPaint\", \"HotDraw\", function()\n    surface.SetDrawColor(r, g, b, a)\n    surface.DrawRect(100, 100, 200, 40)\nend)\n```\nReason: Passing raw channel numbers avoids the extra Color object/table path and any per-frame allocation, so it is the lower-overhead call style for hot draw code.","model_patch":"```lua\nlocal r, g, b, a = 255, 120, 40, 255\n\nhook.Add(\"HUDPaint\", \"HotDraw\", function()\n    surface.SetDrawColor(r, g, b, a)\n    surface.DrawRect(100, 100, 200, 40)\nend)\n```\nReason: Passing raw channel numbers avoids the extra Color object/table path and any per-frame allocation, so it is the lower-overhead call style for hot draw code."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.sqlite-vs-mysql.v1","fixtureId":"gmod.perf.sqlite-vs-mysql.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4a3f5d2a20d71ac9","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16725,"startedAt":"2026-07-10T17:25:55.585Z","completedAt":"2026-07-10T17:26:12.312Z","answerBytes":305,"answerChars":305,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14920,"completionTokens":379,"totalTokens":15299,"reasoningTokens":284,"cachedTokens":14336},"finalResponse":"```lua\nlocal steamId64 = \"76561198000000000\"\nlocal row = sql.QueryRow(\"SELECT cash FROM players WHERE steamid64 = \" .. sql.SQLStr(steamId64))\n```\nReason: Local SQLite via GMod's `sql` library is typically lower latency on a single server because it avoids network round trips and remote database overhead.","model_patch":"```lua\nlocal steamId64 = \"76561198000000000\"\nlocal row = sql.QueryRow(\"SELECT cash FROM players WHERE steamid64 = \" .. sql.SQLStr(steamId64))\n```\nReason: Local SQLite via GMod's `sql` library is typically lower latency on a single server because it avoids network round trips and remote database overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.steamid-cache.v1","fixtureId":"gmod.perf.steamid-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"e8a94aa454154982","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":22650,"startedAt":"2026-07-10T17:25:56.255Z","completedAt":"2026-07-10T17:26:18.906Z","answerBytes":823,"answerChars":823,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14893,"completionTokens":763,"totalTokens":15656,"reasoningTokens":516,"cachedTokens":14336},"finalResponse":"```lua\nlocal PLAYER = FindMetaTable(\"Player\")\n\nfunction PLAYER:GetSteamIDCached()\n    local sid = self._cachedSteamID\n    if sid == nil then\n        sid = self:SteamID()\n        self._cachedSteamID = sid\n    end\n    return sid\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"WarmSteamIDCache\", function(ply)\n    ply._cachedSteamID = ply:SteamID()\nend)\n\nhook.Add(\"PlayerDisconnected\", \"ClearSteamIDCache\", function(ply)\n    ply._cachedSteamID = nil\nend)\n\n-- Hot path\nlocal function ProcessPlayers(players)\n    for i = 1, #players do\n        local ply = players[i]\n        local sid = ply._cachedSteamID or ply:GetSteamIDCached()\n\n        -- use sid here\n    end\nend\n```\nReason: It pays the `SteamID()` method call once per player, then reuses a plain field read in the hot path, which is cheaper than repeated userdata method dispatch.","model_patch":"```lua\nlocal PLAYER = FindMetaTable(\"Player\")\n\nfunction PLAYER:GetSteamIDCached()\n    local sid = self._cachedSteamID\n    if sid == nil then\n        sid = self:SteamID()\n        self._cachedSteamID = sid\n    end\n    return sid\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"WarmSteamIDCache\", function(ply)\n    ply._cachedSteamID = ply:SteamID()\nend)\n\nhook.Add(\"PlayerDisconnected\", \"ClearSteamIDCache\", function(ply)\n    ply._cachedSteamID = nil\nend)\n\n-- Hot path\nlocal function ProcessPlayers(players)\n    for i = 1, #players do\n        local ply = players[i]\n        local sid = ply._cachedSteamID or ply:GetSteamIDCached()\n\n        -- use sid here\n    end\nend\n```\nReason: It pays the `SteamID()` method call once per player, then reuses a plain field read in the hot path, which is cheaper than repeated userdata method dispatch."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.string-table-concat.v1","fixtureId":"gmod.perf.string-table-concat.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b0cf9e04ae7c5dd9","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":20748,"startedAt":"2026-07-10T17:25:59.746Z","completedAt":"2026-07-10T17:26:20.494Z","answerBytes":370,"answerChars":370,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14894,"completionTokens":524,"totalTokens":15418,"reasoningTokens":381,"cachedTokens":14336},"finalResponse":"```lua\n-- Slow:\n-- local big = \"\"\n-- for i = 1, 10000 do\n--     big = big .. (\"piece_\" .. i)\n-- end\n\n-- Fast:\nlocal parts = {}\n\nfor i = 1, 10000 do\n    parts[i] = \"piece_\" .. i\nend\n\nlocal big = table.concat(parts, \"\")\n```\nReason: `table.concat` builds the final string in one pass, avoiding the repeated reallocation and full-string copying caused by `..` inside a loop.","model_patch":"```lua\n-- Slow:\n-- local big = \"\"\n-- for i = 1, 10000 do\n--     big = big .. (\"piece_\" .. i)\n-- end\n\n-- Fast:\nlocal parts = {}\n\nfor i = 1, 10000 do\n    parts[i] = \"piece_\" .. i\nend\n\nlocal big = table.concat(parts, \"\")\n```\nReason: `table.concat` builds the final string in one pass, avoiding the repeated reallocation and full-string copying caused by `..` inside a loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-drawrect.v1","fixtureId":"gmod.perf.surface-drawrect.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"696e8de769d9ad0e","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16607,"startedAt":"2026-07-10T17:25:59.814Z","completedAt":"2026-07-10T17:26:16.422Z","answerBytes":222,"answerChars":222,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14900,"completionTokens":405,"totalTokens":15305,"reasoningTokens":322,"cachedTokens":14336},"finalResponse":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` is a more direct filled-rectangle call and avoids the extra helper/corner-handling overhead in `draw.RoundedBox(0, ...)`. ","model_patch":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` is a more direct filled-rectangle call and avoids the extra helper/corner-handling overhead in `draw.RoundedBox(0, ...)`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-text.v1","fixtureId":"gmod.perf.surface-text.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"95d9fe4918ee4197","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":31623,"startedAt":"2026-07-10T17:26:00.017Z","completedAt":"2026-07-10T17:26:31.641Z","answerBytes":599,"answerChars":599,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14895,"completionTokens":1223,"totalTokens":16118,"reasoningTokens":1034,"cachedTokens":14336},"finalResponse":"```lua\nlocal SetFont = surface.SetFont\nlocal SetTextColor = surface.SetTextColor\nlocal SetTextPos = surface.SetTextPos\nlocal DrawText = surface.DrawText\n\nlocal FONT = \"DermaDefaultBold\"\nlocal TEXT = \"Single line every frame\"\nlocal X, Y = 24, 24\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    SetFont(FONT)\n    SetTextColor(255, 255, 255, 255)\n    SetTextPos(X, Y)\n    DrawText(TEXT)\nend)\n```\nReason: Direct `surface` text calls are faster for a single-line draw because they avoid the extra wrapper work in `draw.DrawText` and the multiple text passes used by `draw.SimpleTextOutlined`. ","model_patch":"```lua\nlocal SetFont = surface.SetFont\nlocal SetTextColor = surface.SetTextColor\nlocal SetTextPos = surface.SetTextPos\nlocal DrawText = surface.DrawText\n\nlocal FONT = \"DermaDefaultBold\"\nlocal TEXT = \"Single line every frame\"\nlocal X, Y = 24, 24\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    SetFont(FONT)\n    SetTextColor(255, 255, 255, 255)\n    SetTextPos(X, Y)\n    DrawText(TEXT)\nend)\n```\nReason: Direct `surface` text calls are faster for a single-line draw because they avoid the extra wrapper work in `draw.DrawText` and the multiple text passes used by `draw.SimpleTextOutlined`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-count-hash.v1","fixtureId":"gmod.perf.table-count-hash.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3e9bbfc8452e05e3","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12617,"startedAt":"2026-07-10T17:26:01.275Z","completedAt":"2026-07-10T17:26:13.894Z","answerBytes":178,"answerChars":178,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14889,"completionTokens":175,"totalTokens":15064,"reasoningTokens":111,"cachedTokens":14336},"finalResponse":"```lua\nlocal len = #myTable\n```\nReason: `#` is the preferred way to get the length of a sequential array-like table; `table.Count` is for non-sequential keys and does extra work.","model_patch":"```lua\nlocal len = #myTable\n```\nReason: `#` is the preferred way to get the length of a sequential array-like table; `table.Count` is for non-sequential keys and does extra work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-empty.v1","fixtureId":"gmod.perf.table-empty.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3a6344977f5bd475","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":17776,"startedAt":"2026-07-10T17:26:02.256Z","completedAt":"2026-07-10T17:26:20.033Z","answerBytes":251,"answerChars":251,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14898,"completionTokens":420,"totalTokens":15318,"reasoningTokens":344,"cachedTokens":14336},"finalResponse":"```lua\nt = {}\n```\nReason: `t = {}` is generally faster because it replaces the large sequential table instead of iterating and niling every element like `table.Empty(t)`; only keep `table.Empty(t)` when other code must retain the same table reference.","model_patch":"```lua\nt = {}\n```\nReason: `t = {}` is generally faster because it replaces the large sequential table instead of iterating and niling every element like `table.Empty(t)`; only keep `table.Empty(t)` when other code must retain the same table reference."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-hasvalue.v1","fixtureId":"gmod.perf.table-hasvalue.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7d064428a873fdfc","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":20739,"startedAt":"2026-07-10T17:26:05.065Z","completedAt":"2026-07-10T17:26:25.805Z","answerBytes":277,"answerChars":277,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14898,"completionTokens":461,"totalTokens":15359,"reasoningTokens":362,"cachedTokens":14336},"finalResponse":"```lua\nlocal allowed = {\n    pistol = true,\n    shotgun = true,\n    crowbar = true,\n}\n\nif allowed[weaponClass] then\n    -- value exists\nend\n```\nReason: A set-style table uses direct key lookup with average O(1) cost, while `table.HasValue` walks a list linearly with O(n) cost.","model_patch":"```lua\nlocal allowed = {\n    pistol = true,\n    shotgun = true,\n    crowbar = true,\n}\n\nif allowed[weaponClass] then\n    -- value exists\nend\n```\nReason: A set-style table uses direct key lookup with average O(1) cost, while `table.HasValue` walks a list linearly with O(n) cost."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-literal.v1","fixtureId":"gmod.perf.table-literal.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f95a8fc610d720ad","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":21596,"startedAt":"2026-07-10T17:26:07.396Z","completedAt":"2026-07-10T17:26:28.993Z","answerBytes":409,"answerChars":409,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14897,"completionTokens":651,"totalTokens":15548,"reasoningTokens":516,"cachedTokens":14336},"finalResponse":"```lua\n-- Faster for a small table with known fields:\nlocal t = {\n    x = 10,\n    y = 20,\n    name = \"npc\",\n}\n\n-- Slower:\n-- local t = {}\n-- t.x = 10\n-- t.y = 20\n-- t.name = \"npc\"\n```\nReason: Putting known fields directly in the table constructor is faster because Lua can build the table in one step with fewer bytecode operations and fewer hash inserts than creating `{}` and assigning each field afterward.","model_patch":"```lua\n-- Faster for a small table with known fields:\nlocal t = {\n    x = 10,\n    y = 20,\n    name = \"npc\",\n}\n\n-- Slower:\n-- local t = {}\n-- t.x = 10\n-- t.y = 20\n-- t.name = \"npc\"\n```\nReason: Putting known fields directly in the table constructor is faster because Lua can build the table in one step with fewer bytecode operations and fewer hash inserts than creating `{}` and assigning each field afterward."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-random.v1","fixtureId":"gmod.perf.table-random.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f3e090701953d4a9","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":17175,"startedAt":"2026-07-10T17:26:09.175Z","completedAt":"2026-07-10T17:26:26.352Z","answerBytes":332,"answerChars":332,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14891,"completionTokens":349,"totalTokens":15240,"reasoningTokens":245,"cachedTokens":14336},"finalResponse":"```lua\nlocal function randomSequential(t)\n    local n = #t\n    if n == 0 then return nil end\n    return t[math.random(n)]\nend\n\nlocal value = randomSequential(myTable)\n```\nReason: `table.Random` handles general tables, but a sequential table can skip that overhead and pick a random numeric index directly with `t[math.random(#t)]`. ","model_patch":"```lua\nlocal function randomSequential(t)\n    local n = #t\n    if n == 0 then return nil end\n    return t[math.random(n)]\nend\n\nlocal value = randomSequential(myTable)\n```\nReason: `table.Random` handles general tables, but a sequential table can skip that overhead and pick a random numeric index directly with `t[math.random(#t)]`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.x-times-x.v1","fixtureId":"gmod.perf.x-times-x.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"79d48008f6b5174f","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13176,"startedAt":"2026-07-10T17:26:09.320Z","completedAt":"2026-07-10T17:26:22.497Z","answerBytes":148,"answerChars":148,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14888,"completionTokens":209,"totalTokens":15097,"reasoningTokens":150,"cachedTokens":14336},"finalResponse":"```lua\nlocal y = x * x\n```\nReason: `x * x` is the fast preferred form in a tight loop because it avoids the slower exponentiation operator `x ^ 2`. ","model_patch":"```lua\nlocal y = x * x\n```\nReason: `x * x` is the fast preferred form in a tight loop because it avoids the slower exponentiation operator `x ^ 2`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.player-iterator.v1","fixtureId":"gmod.player-iterator.v1","fixtureVersion":2,"rubricVersion":"4","promptHash":"fe3d7469535a0ca2","adapterId":"codex","model":"gpt-5.4@xhigh","model_name_or_path":"gpt-5.4@xhigh","attemptIndex":1,"status":"pass","detail":"Uses player.Iterator() (wiki-recommended Lua-cached iterator).","durationMs":21353,"startedAt":"2026-07-10T17:26:10.987Z","completedAt":"2026-07-10T17:26:32.341Z","answerBytes":191,"answerChars":191,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14904,"completionTokens":577,"totalTokens":15481,"reasoningTokens":516,"cachedTokens":14336},"finalResponse":"```lua\nfor _, ply in player.Iterator() do\n    -- ...\nend\n```\nReason: `player.Iterator()` visits connected players directly without creating the temporary table that `player.GetAll()` returns.","model_patch":"```lua\nfor _, ply in player.Iterator() do\n    -- ...\nend\n```\nReason: `player.Iterator()` visits connected players directly without creating the temporary table that `player.GetAll()` returns."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.ents-iterator.v1","fixtureId":"gmod.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"3990c92253db85bb","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12457,"startedAt":"2026-07-10T17:26:12.313Z","completedAt":"2026-07-10T17:26:24.770Z","answerBytes":224,"answerChars":224,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14543,"completionTokens":220,"totalTokens":14763,"reasoningTokens":145,"cachedTokens":0},"finalResponse":"```lua\nfor ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- handle ent here\n    end\nend\n```\nReason: `ents.Iterator()` walks entities directly, so it avoids building a full entity table first.","model_patch":"```lua\nfor ent in ents.Iterator() do\n    if ent:GetClass() == \"prop_physics\" then\n        -- handle ent here\n    end\nend\n```\nReason: `ents.Iterator()` walks entities directly, so it avoids building a full entity table first."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.hook-add.v1","fixtureId":"gmod.hook-add.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"12d2222fdb7d6b90","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Registers a named hook with hook.Add.","durationMs":11293,"startedAt":"2026-07-10T17:26:13.116Z","completedAt":"2026-07-10T17:26:24.410Z","answerBytes":180,"answerChars":180,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14549,"completionTokens":74,"totalTokens":14623,"reasoningTokens":8,"cachedTokens":0},"finalResponse":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\nend)\n```\nReason: Registers a Think hook callback under the `MyAddon.Think` identifier so Garry's Mod can invoke it every frame.","model_patch":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\nend)\n```\nReason: Registers a Think hook callback under the `MyAddon.Think` identifier so Garry's Mod can invoke it every frame."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.isvalid.v1","fixtureId":"gmod.isvalid.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"35527312e59dfc13","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Uses IsValid for entity/object validity.","durationMs":10680,"startedAt":"2026-07-10T17:26:13.292Z","completedAt":"2026-07-10T17:26:23.973Z","answerBytes":195,"answerChars":195,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14544,"completionTokens":75,"totalTokens":14619,"reasoningTokens":8,"cachedTokens":0},"finalResponse":"```lua\nif IsValid(ent) then\n    -- safe to call methods on ent here\nend\n```\nReason: `IsValid` checks that the entity reference still points to a live, usable entity before you call methods on it.","model_patch":"```lua\nif IsValid(ent) then\n    -- safe to call methods on ent here\nend\n```\nReason: `IsValid` checks that the entity reference still points to a live, usable entity before you call methods on it."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.net-receivers.v1","fixtureId":"gmod.net-receivers.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"24d54ee8366753a6","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":15321,"startedAt":"2026-07-10T17:26:13.418Z","completedAt":"2026-07-10T17:26:28.741Z","answerBytes":213,"answerChars":213,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14539,"completionTokens":80,"totalTokens":14619,"reasoningTokens":10,"cachedTokens":0},"finalResponse":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle the incoming message here\nend)\n```\nReason: `net.Receive` registers the client or server callback for an incoming Garry's Mod net message by name.","model_patch":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle the incoming message here\nend)\n```\nReason: `net.Receive` registers the client or server callback for an incoming Garry's Mod net message by name."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.angle-zero.v1","fixtureId":"gmod.perf.angle-zero.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f6bc97bf98280d62","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":13781,"startedAt":"2026-07-10T17:26:13.895Z","completedAt":"2026-07-10T17:26:27.677Z","answerBytes":270,"answerChars":270,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14543,"completionTokens":189,"totalTokens":14732,"reasoningTokens":90,"cachedTokens":0},"finalResponse":"```lua\nlocal zero = angle_zero\n\n-- hot path\nlocal a = zero\n-- use `a` as a zeroed Angle without allocating a new one\n\n-- slower\nlocal b = Angle(0, 0, 0)\n``` \nReason: `angle_zero` is a shared zeroed Angle, so reusing it avoids repeated `Angle()` allocations in hot paths.","model_patch":"```lua\nlocal zero = angle_zero\n\n-- hot path\nlocal a = zero\n-- use `a` as a zeroed Angle without allocating a new one\n\n-- slower\nlocal b = Angle(0, 0, 0)\n``` \nReason: `angle_zero` is a shared zeroed Angle, so reusing it avoids repeated `Angle()` allocations in hot paths."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.config-var.v1","fixtureId":"gmod.perf.config-var.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"bcc4ff8eb162b699","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":10712,"startedAt":"2026-07-10T17:26:16.423Z","completedAt":"2026-07-10T17:26:27.136Z","answerBytes":228,"answerChars":228,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14546,"completionTokens":101,"totalTokens":14647,"reasoningTokens":23,"cachedTokens":0},"finalResponse":"```lua\nlocal myaddon_config_color = Color(255, 255, 255)\n\nlocal color = myaddon_config_color\n```\nReason: a flat local avoids repeated table lookups, so it is faster for a hot, frequently read setting than `myaddon.config.color`.","model_patch":"```lua\nlocal myaddon_config_color = Color(255, 255, 255)\n\nlocal color = myaddon_config_color\n```\nReason: a flat local avoids repeated table lookups, so it is faster for a hot, frequently read setting than `myaddon.config.color`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.darkrpvar.v1","fixtureId":"gmod.perf.darkrpvar.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"02a37daa699cded3","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5862,"startedAt":"2026-07-10T17:26:18.907Z","completedAt":"2026-07-10T17:26:24.770Z","answerBytes":256,"answerChars":250,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14544,"completionTokens":103,"totalTokens":14647,"reasoningTokens":14,"cachedTokens":0},"finalResponse":"```lua\nply:getDarkRPVar(\"job\")\n```\nReason: `getDarkRPVar(\"job\")` is DarkRP’s job API and is the preferred way to read a player’s job name; `GetNWString(\"job\")` is the lower-level networked-value fallback and may not match DarkRP’s own state handling.","model_patch":"```lua\nply:getDarkRPVar(\"job\")\n```\nReason: `getDarkRPVar(\"job\")` is DarkRP’s job API and is the preferred way to read a player’s job name; `GetNWString(\"job\")` is the lower-level networked-value fallback and may not match DarkRP’s own state handling."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.disttosqr.v1","fixtureId":"gmod.perf.disttosqr.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a5772470c6859cdc","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4265,"startedAt":"2026-07-10T17:26:20.034Z","completedAt":"2026-07-10T17:26:24.300Z","answerBytes":184,"answerChars":184,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14545,"completionTokens":78,"totalTokens":14623,"reasoningTokens":8,"cachedTokens":0},"finalResponse":"```lua\nif vec1:DistToSqr(vec2) < threshold * threshold then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root, so it is the preferred method for a threshold check.","model_patch":"```lua\nif vec1:DistToSqr(vec2) < threshold * threshold then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root, so it is the preferred method for a threshold check."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ents-iterator.v1","fixtureId":"gmod.perf.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"306d3f1d05f28246","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4992,"startedAt":"2026-07-10T17:26:20.495Z","completedAt":"2026-07-10T17:26:25.489Z","answerBytes":256,"answerChars":256,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14541,"completionTokens":143,"totalTokens":14684,"reasoningTokens":68,"cachedTokens":13824},"finalResponse":"```lua\nfor ent in ents.Iterator() do\n    -- visit every entity here\nend\n```\nReason: `ents.Iterator()` is the wiki-recommended efficient way to traverse all entities when you want to iterate them directly without building a full `ents.GetAll()` table first.","model_patch":"```lua\nfor ent in ents.Iterator() do\n    -- visit every entity here\nend\n```\nReason: `ents.Iterator()` is the wiki-recommended efficient way to traverse all entities when you want to iterate them directly without building a full `ents.GetAll()` table first."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-ents-near.v1","fixtureId":"gmod.perf.find-ents-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"07c583fc3d9fe09f","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":5493,"startedAt":"2026-07-10T17:26:22.498Z","completedAt":"2026-07-10T17:26:27.993Z","answerBytes":503,"answerChars":503,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14564,"completionTokens":204,"totalTokens":14768,"reasoningTokens":47,"cachedTokens":0},"finalResponse":"```lua\nlocal ply = Entity(1) -- or any player entity\nif not IsValid(ply) then return end\n\nlocal pos = ply:GetPos()\nlocal radius = 512\nlocal nearby = ents.FindInSphere(pos, radius)\n\nfor i = 1, #nearby do\n    local ent = nearby[i]\n    if IsValid(ent) and ent ~= ply then\n        -- cheap per-entity filtering here\n    end\nend\n```\nReason: `ents.FindInSphere` is one of the faster built-in spatial queries in common GMod benchmarks, and it is the simplest cheap broad-phase query for entities near a player.","model_patch":"```lua\nlocal ply = Entity(1) -- or any player entity\nif not IsValid(ply) then return end\n\nlocal pos = ply:GetPos()\nlocal radius = 512\nlocal nearby = ents.FindInSphere(pos, radius)\n\nfor i = 1, #nearby do\n    local ent = nearby[i]\n    if IsValid(ent) and ent ~= ply then\n        -- cheap per-entity filtering here\n    end\nend\n```\nReason: `ents.FindInSphere` is one of the faster built-in spatial queries in common GMod benchmarks, and it is the simplest cheap broad-phase query for entities near a player."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-players-near.v1","fixtureId":"gmod.perf.find-players-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d139ba2e8ee38a2f","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5409,"startedAt":"2026-07-10T17:26:23.973Z","completedAt":"2026-07-10T17:26:29.384Z","answerBytes":460,"answerChars":460,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":115,"totalTokens":194,"source":"estimated"},"finalResponse":"```lua\nlocal function PlayersInRadius(pos, radius)\n    local radiusSqr = radius * radius\n    local out = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if pos:DistToSqr(ply:GetPos()) <= radiusSqr then\n            out[#out + 1] = ply\n        end\n    end\n\n    return out\nend\n``` \nReason: `player.GetAll()` gives only players, so it avoids building and filtering a mixed entity list from `ents.FindInSphere`; `DistToSqr` also skips the square-root cost.","model_patch":"```lua\nlocal function PlayersInRadius(pos, radius)\n    local radiusSqr = radius * radius\n    local out = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if pos:DistToSqr(ply:GetPos()) <= radiusSqr then\n            out[#out + 1] = ply\n        end\n    end\n\n    return out\nend\n``` \nReason: `player.GetAll()` gives only players, so it avoids building and filtering a mixed entity list from `ents.FindInSphere`; `DistToSqr` also skips the square-root cost."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.for-vs-while.v1","fixtureId":"gmod.perf.for-vs-while.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b3401a190a8aecf0","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4115,"startedAt":"2026-07-10T17:26:24.301Z","completedAt":"2026-07-10T17:26:28.418Z","answerBytes":218,"answerChars":218,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":65,"completionTokens":55,"totalTokens":120,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, n do\n    -- tight counting loop\nend\n```\nReason: Numeric `for` is generally faster than `while` in Garry's Mod Lua because the VM optimizes it as a dedicated loop form with less per-iteration overhead.","model_patch":"```lua\nfor i = 1, n do\n    -- tight counting loop\nend\n```\nReason: Numeric `for` is generally faster than `while` in Garry's Mod Lua because the VM optimizes it as a dedicated loop form with less per-iteration overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hook-once.v1","fixtureId":"gmod.perf.hook-once.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ed1d3e09249fc8bb","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":10074,"startedAt":"2026-07-10T17:26:24.412Z","completedAt":"2026-07-10T17:26:34.488Z","answerBytes":406,"answerChars":406,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":84,"completionTokens":102,"totalTokens":186,"source":"estimated"},"finalResponse":"```lua\n-- Faster: one hook call per tick, pass the whole player list once.\nlocal players = player.GetAll()\nhook.Run(\"MyCustomTick\", players)\n\n-- Slower: one hook call per player per tick.\nfor i = 1, #players do\n    hook.Run(\"MyCustomTick\", players[i])\nend\n``` \nReason: One `hook.Run` call avoids repeating hook dispatch overhead for every player, so it is cheaper than calling it once per player each tick.","model_patch":"```lua\n-- Faster: one hook call per tick, pass the whole player list once.\nlocal players = player.GetAll()\nhook.Run(\"MyCustomTick\", players)\n\n-- Slower: one hook call per player per tick.\nfor i = 1, #players do\n    hook.Run(\"MyCustomTick\", players[i])\nend\n``` \nReason: One `hook.Run` call avoids repeating hook dispatch overhead for every player, so it is cheaper than calling it once per player each tick."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hudpaint-cache.v1","fixtureId":"gmod.perf.hudpaint-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3def450f3158ceff","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3994,"startedAt":"2026-07-10T17:26:24.771Z","completedAt":"2026-07-10T17:26:28.767Z","answerBytes":346,"answerChars":346,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":87,"totalTokens":163,"source":"estimated"},"finalResponse":"```lua\nlocal lp = LocalPlayer()\nlocal hp = lp:Health()\n\n-- use hp for all three draw calls below\n-- draw first bar based on hp\n-- draw second bar based on hp\n-- draw third bar based on hp\n```\nReason: Cache `LocalPlayer()` and `:Health()` once per frame so the hook does one player lookup and one health read instead of repeating both three times.","model_patch":"```lua\nlocal lp = LocalPlayer()\nlocal hp = lp:Health()\n\n-- use hp for all three draw calls below\n-- draw first bar based on hp\n-- draw second bar based on hp\n-- draw third bar based on hp\n```\nReason: Cache `LocalPlayer()` and `:Health()` once per frame so the hook does one player lookup and one health read instead of repeating both three times."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-color.v1","fixtureId":"gmod.perf.local-color.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"16a7bed1b931d467","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4261,"startedAt":"2026-07-10T17:26:24.771Z","completedAt":"2026-07-10T17:26:29.039Z","answerBytes":240,"answerChars":240,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":60,"totalTokens":123,"source":"estimated"},"finalResponse":"```lua\nlocal white = color_white\n\nfor i = 1, count do\n    surface.SetDrawColor(white)\n    -- paint work here\nend\n```\nReason: Reuses Garry's Mod's shared `color_white` instead of allocating a new `Color(255, 255, 255)` table every iteration.","model_patch":"```lua\nlocal white = color_white\n\nfor i = 1, count do\n    surface.SetDrawColor(white)\n    -- paint work here\nend\n```\nReason: Reuses Garry's Mod's shared `color_white` instead of allocating a new `Color(255, 255, 255)` table every iteration."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-vs-global.v1","fixtureId":"gmod.perf.local-vs-global.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"c116d8c651190647","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3744,"startedAt":"2026-07-10T17:26:25.490Z","completedAt":"2026-07-10T17:26:29.235Z","answerBytes":188,"answerChars":188,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":47,"totalTokens":109,"source":"estimated"},"finalResponse":"```lua\nlocal sin = math.sin\n\nfor i = 1, 1000000 do\n    local y = sin(i)\n    -- use y\nend\n``` \nReason: Caching `math.sin` in a local avoids repeated global/table lookup inside the hot loop.","model_patch":"```lua\nlocal sin = math.sin\n\nfor i = 1, 1000000 do\n    local y = sin(i)\n    -- use y\nend\n``` \nReason: Caching `math.sin` in a local avoids repeated global/table lookup inside the hot loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.localplayer-cache.v1","fixtureId":"gmod.perf.localplayer-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7398105af47b079e","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3946,"startedAt":"2026-07-10T17:26:25.806Z","completedAt":"2026-07-10T17:26:29.752Z","answerBytes":452,"answerChars":452,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":113,"totalTokens":183,"source":"estimated"},"finalResponse":"```lua\nlocal LocalPlayer = LocalPlayer\n\nhook.Add(\"Think\", \"ExampleCachedLocalPlayer\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    -- use lp many times here instead of calling LocalPlayer() repeatedly\nend)\n``` \nReason: Caching the global function in a local avoids repeated global table lookup, and storing the player in a local inside the hot path avoids calling `LocalPlayer()` multiple times in the same frame.","model_patch":"```lua\nlocal LocalPlayer = LocalPlayer\n\nhook.Add(\"Think\", \"ExampleCachedLocalPlayer\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    -- use lp many times here instead of calling LocalPlayer() repeatedly\nend)\n``` \nReason: Caching the global function in a local avoids repeated global table lookup, and storing the player in a local inside the hot path avoids calling `LocalPlayer()` multiple times in the same frame."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.looking-at.v1","fixtureId":"gmod.perf.looking-at.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"20b22f678a4b08d7","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":4868,"startedAt":"2026-07-10T17:26:26.352Z","completedAt":"2026-07-10T17:26:31.222Z","answerBytes":505,"answerChars":505,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":91,"completionTokens":127,"totalTokens":218,"source":"estimated"},"finalResponse":"```lua\nlocal function RoughlyLookingAtEachOther(p1, p2, threshold)\n    threshold = threshold or 0.90 -- closer to 1.0 = stricter\n\n    local a1 = p1:EyeAngles():Forward()\n    local a2 = p2:EyeAngles():Forward()\n    local to2 = (p2:EyePos() - p1:EyePos()):GetNormalized()\n    local to1 = -to2\n\n    return a1:Dot(to2) >= threshold and a2:Dot(to1) >= threshold\nend\n```\nReason: Dot products are cheaper than acos and directly test how aligned each player's aim vector is with the direction to the other player.","model_patch":"```lua\nlocal function RoughlyLookingAtEachOther(p1, p2, threshold)\n    threshold = threshold or 0.90 -- closer to 1.0 = stricter\n\n    local a1 = p1:EyeAngles():Forward()\n    local a2 = p2:EyeAngles():Forward()\n    local to2 = (p2:EyePos() - p1:EyePos()):GetNormalized()\n    local to1 = -to2\n\n    return a1:Dot(to2) >= threshold and a2:Dot(to1) >= threshold\nend\n```\nReason: Dot products are cheaper than acos and directly test how aligned each player's aim vector is with the direction to the other player."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.meta-vs-arg.v1","fixtureId":"gmod.perf.meta-vs-arg.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de332f7356830dfa","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3452,"startedAt":"2026-07-10T17:26:27.137Z","completedAt":"2026-07-10T17:26:30.590Z","answerBytes":277,"answerChars":277,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":70,"totalTokens":141,"source":"estimated"},"finalResponse":"```lua\nSomeHelper(ply)\n```\nReason: For a helper you control, the free-function style is generally a bit faster and easier to optimize because it avoids method-call lookup and implicit self dispatch; the difference is usually small, but `SomeHelper(ply)` is the preferred style.","model_patch":"```lua\nSomeHelper(ply)\n```\nReason: For a helper you control, the free-function style is generally a bit faster and easier to optimize because it avoids method-call lookup and implicit self dispatch; the difference is usually small, but `SomeHelper(ply)` is the preferred style."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.msg-vs-print.v1","fixtureId":"gmod.perf.msg-vs-print.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"6cbb4e4b2f19dd24","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4118,"startedAt":"2026-07-10T17:26:27.678Z","completedAt":"2026-07-10T17:26:31.797Z","answerBytes":187,"answerChars":187,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":47,"totalTokens":110,"source":"estimated"},"finalResponse":"```lua\nMsgN(\"debug: hot path hit\")\n```\nReason: `MsgN` writes straight to the console and avoids `print`'s extra formatting overhead, so it is the lighter choice for hot-path debug output.","model_patch":"```lua\nMsgN(\"debug: hot path hit\")\n```\nReason: `MsgN` writes straight to the console and avoids `print`'s extra formatting overhead, so it is the lighter choice for hot-path debug output."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.pairs-ipairs-for.v1","fixtureId":"gmod.perf.pairs-ipairs-for.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de5e4875fcf3e600","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4803,"startedAt":"2026-07-10T17:26:27.994Z","completedAt":"2026-07-10T17:26:32.798Z","answerBytes":252,"answerChars":252,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":63,"totalTokens":136,"source":"estimated"},"finalResponse":"```lua\n-- Fastest typical loop for a dense array-like table\nfor i = 1, #t do\n    local v = t[i]\n    -- use v\nend\n```\nReason: Numeric `for` is typically fastest for large sequential tables because it avoids the iterator overhead of `pairs` and `ipairs`.","model_patch":"```lua\n-- Fastest typical loop for a dense array-like table\nfor i = 1, #t do\n    local v = t[i]\n    -- use v\nend\n```\nReason: Numeric `for` is typically fastest for large sequential tables because it avoids the iterator overhead of `pairs` and `ipairs`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.plain-lua-vs-fn.v1","fixtureId":"gmod.perf.plain-lua-vs-fn.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ead0a98b3ff6a388","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5600,"startedAt":"2026-07-10T17:26:28.418Z","completedAt":"2026-07-10T17:26:34.020Z","answerBytes":653,"answerChars":653,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":164,"totalTokens":240,"source":"estimated"},"finalResponse":"```lua\n-- Faster than chaining DarkRP fn combinators: one pass, no temp closures, no temp lists.\nlocal function filterMap(list, keep, map)\n  local out = {}\n  local n = 0\n\n  for i = 1, #list do\n    local v = list[i]\n    if keep(v, i, list) then\n      n = n + 1\n      out[n] = map(v, i, list)\n    end\n  end\n\n  return out\nend\n\n-- Example:\n-- local result = filterMap(players.GetAll(),\n--   function(p) return p:Alive() end,\n--   function(p) return p:Nick() end\n-- )\n``` \nReason: This does filter and map in a single numeric for loop, so it avoids the extra function-call overhead, iterator chaining, and intermediate tables that fn combinators usually add.","model_patch":"```lua\n-- Faster than chaining DarkRP fn combinators: one pass, no temp closures, no temp lists.\nlocal function filterMap(list, keep, map)\n  local out = {}\n  local n = 0\n\n  for i = 1, #list do\n    local v = list[i]\n    if keep(v, i, list) then\n      n = n + 1\n      out[n] = map(v, i, list)\n    end\n  end\n\n  return out\nend\n\n-- Example:\n-- local result = filterMap(players.GetAll(),\n--   function(p) return p:Alive() end,\n--   function(p) return p:Nick() end\n-- )\n``` \nReason: This does filter and map in a single numeric for loop, so it avoids the extra function-call overhead, iterator chaining, and intermediate tables that fn combinators usually add."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.player-cache-hooks.v1","fixtureId":"gmod.perf.player-cache-hooks.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a834817afe9e6c25","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6809,"startedAt":"2026-07-10T17:26:28.742Z","completedAt":"2026-07-10T17:26:35.552Z","answerBytes":626,"answerChars":626,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":88,"completionTokens":157,"totalTokens":245,"source":"estimated"},"finalResponse":"```lua\nlocal cachedPlayers = {}\n\nlocal function refreshPlayers()\n    cachedPlayers = player.GetAll()\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"RefreshCachedPlayers\", refreshPlayers)\nhook.Add(\"PlayerDisconnected\", \"RefreshCachedPlayers\", refreshPlayers)\n\nhook.Add(\"Tick\", \"ProcessCachedPlayers\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n        if IsValid(ply) then\n            -- work with ply here\n        end\n    end\nend)\n\nrefreshPlayers()\n``` \nReason: `player.GetAll()` allocates and walks the player list; caching it and refreshing only on join/leave removes that repeated per-tick work.","model_patch":"```lua\nlocal cachedPlayers = {}\n\nlocal function refreshPlayers()\n    cachedPlayers = player.GetAll()\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"RefreshCachedPlayers\", refreshPlayers)\nhook.Add(\"PlayerDisconnected\", \"RefreshCachedPlayers\", refreshPlayers)\n\nhook.Add(\"Tick\", \"ProcessCachedPlayers\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n        if IsValid(ply) then\n            -- work with ply here\n        end\n    end\nend)\n\nrefreshPlayers()\n``` \nReason: `player.GetAll()` allocates and walks the player list; caching it and refreshing only on join/leave removes that repeated per-tick work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ply-table-index.v1","fixtureId":"gmod.perf.ply-table-index.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f18cc80df8999147","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5033,"startedAt":"2026-07-10T17:26:28.769Z","completedAt":"2026-07-10T17:26:33.804Z","answerBytes":406,"answerChars":406,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":69,"completionTokens":102,"totalTokens":171,"source":"estimated"},"finalResponse":"```lua\nlocal tempData = setmetatable({}, { __mode = \"k\" }) -- weak keys so player entries can vanish\n\n-- write\nfunction SetTempValue(ply, value)\n    tempData[ply] = value\nend\n\n-- read\nfunction GetTempValue(ply)\n    return tempData[ply]\nend\n``` \nReason: a single shared lookup table avoids creating extra fields on each player object and gives you a tight `tempData[ply]` read path for hot per-player state.","model_patch":"```lua\nlocal tempData = setmetatable({}, { __mode = \"k\" }) -- weak keys so player entries can vanish\n\n-- write\nfunction SetTempValue(ply, value)\n    tempData[ply] = value\nend\n\n-- read\nfunction GetTempValue(ply)\n    return tempData[ply]\nend\n``` \nReason: a single shared lookup table avoids creating extra fields on each player object and gives you a tight `tempData[ply]` read path for hot per-player state."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.seq-tables.v1","fixtureId":"gmod.perf.seq-tables.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4778b0220c3f91a3","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 1 candidate loops.","durationMs":4386,"startedAt":"2026-07-10T17:26:28.994Z","completedAt":"2026-07-10T17:26:33.383Z","answerBytes":433,"answerChars":433,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14549,"completionTokens":172,"totalTokens":14721,"reasoningTokens":27,"cachedTokens":13824},"finalResponse":"```lua\nlocal array = { \"a\", \"b\", \"c\" }\nlocal map = { first = \"a\", second = \"b\", third = \"c\" }\n\n-- Faster for fixed-order iteration:\nfor i = 1, #array do\n    local value = array[i]\nend\n\n-- Slower for this use case:\nfor key, value in pairs(map) do\nend\n```\nReason: Sequential number-indexed arrays are faster to iterate than string-keyed maps because Lua can traverse the array part directly, while string-keyed tables use hash lookups.","model_patch":"```lua\nlocal array = { \"a\", \"b\", \"c\" }\nlocal map = { first = \"a\", second = \"b\", third = \"c\" }\n\n-- Faster for fixed-order iteration:\nfor i = 1, #array do\n    local value = array[i]\nend\n\n-- Slower for this use case:\nfor key, value in pairs(map) do\nend\n```\nReason: Sequential number-indexed arrays are faster to iterate than string-keyed maps because Lua can traverse the array part directly, while string-keyed tables use hash lookups."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.setdrawcolor-split.v1","fixtureId":"gmod.perf.setdrawcolor-split.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d110fde8a37bbe59","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4439,"startedAt":"2026-07-10T17:26:29.039Z","completedAt":"2026-07-10T17:26:33.480Z","answerBytes":187,"answerChars":187,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":47,"totalTokens":118,"source":"estimated"},"finalResponse":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Passing raw r,g,b,a numbers avoids constructing or unpacking a `Color` object, which is the lighter choice for a hot draw path.","model_patch":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Passing raw r,g,b,a numbers avoids constructing or unpacking a `Color` object, which is the lighter choice for a hot draw path."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.sqlite-vs-mysql.v1","fixtureId":"gmod.perf.sqlite-vs-mysql.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4a3f5d2a20d71ac9","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3743,"startedAt":"2026-07-10T17:26:29.235Z","completedAt":"2026-07-10T17:26:32.979Z","answerBytes":240,"answerChars":240,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":100,"completionTokens":60,"totalTokens":160,"source":"estimated"},"finalResponse":"```lua\nsql.Query(\"SELECT * FROM player_data WHERE steamid = 'STEAM_0:1:12345'\")\n```\nReason: Local SQLite is typically lower latency for a single Garry's Mod server because it avoids network round trips and uses an on-disk embedded database.","model_patch":"```lua\nsql.Query(\"SELECT * FROM player_data WHERE steamid = 'STEAM_0:1:12345'\")\n```\nReason: Local SQLite is typically lower latency for a single Garry's Mod server because it avoids network round trips and uses an on-disk embedded database."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.steamid-cache.v1","fixtureId":"gmod.perf.steamid-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"e8a94aa454154982","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain exactly one fenced code block followed by a reason.","durationMs":6269,"startedAt":"2026-07-10T17:26:29.385Z","completedAt":"2026-07-10T17:26:35.656Z","answerBytes":628,"answerChars":628,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14541,"completionTokens":204,"totalTokens":14745,"reasoningTokens":12,"cachedTokens":13824},"finalResponse":"```lua\nlocal steamid_cache = setmetatable({}, { __mode = \"k\" })\n\nlocal function GetSteamIDCached(ply)\n    local steamid = steamid_cache[ply]\n    if steamid == nil then\n        steamid = ply:SteamID()\n        steamid_cache[ply] = steamid\n    end\n    return steamid\nend\n\nhook.Add(\"PlayerDisconnected\", \"ClearSteamIDCache\", function(ply)\n    steamid_cache[ply] = nil\nend)\n\n-- hot path usage:\n-- local sid = GetSteamIDCached(ply)\n```lua\nReason: Caches each player's SteamID once and reuses it on hot paths, avoiding repeated method calls while the weak-key table lets entries fall out when the player entity is no longer referenced.","model_patch":"```lua\nlocal steamid_cache = setmetatable({}, { __mode = \"k\" })\n\nlocal function GetSteamIDCached(ply)\n    local steamid = steamid_cache[ply]\n    if steamid == nil then\n        steamid = ply:SteamID()\n        steamid_cache[ply] = steamid\n    end\n    return steamid\nend\n\nhook.Add(\"PlayerDisconnected\", \"ClearSteamIDCache\", function(ply)\n    steamid_cache[ply] = nil\nend)\n\n-- hot path usage:\n-- local sid = GetSteamIDCached(ply)\n```lua\nReason: Caches each player's SteamID once and reuses it on hot paths, avoiding repeated method calls while the weak-key table lets entries fall out when the player entity is no longer referenced."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.string-table-concat.v1","fixtureId":"gmod.perf.string-table-concat.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b0cf9e04ae7c5dd9","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":5511,"startedAt":"2026-07-10T17:26:29.753Z","completedAt":"2026-07-10T17:26:35.265Z","answerBytes":495,"answerChars":495,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14546,"completionTokens":181,"totalTokens":14727,"reasoningTokens":8,"cachedTokens":13824},"finalResponse":"```lua\n-- Slow: repeated .. creates many intermediate strings\nlocal out = \"\"\nfor i = 1, 10000 do\n    out = out .. \"piece\" .. i .. \",\"\nend\n\n-- Fast: collect parts, then join once\nlocal parts = {}\nfor i = 1, 10000 do\n    parts[#parts + 1] = \"piece\"\n    parts[#parts + 1] = tostring(i)\n    parts[#parts + 1] = \",\"\nend\nlocal out2 = table.concat(parts)\n```\nReason: `table.concat` builds the final string in one pass, avoiding the repeated intermediate allocations and copies caused by `..` in a loop.","model_patch":"```lua\n-- Slow: repeated .. creates many intermediate strings\nlocal out = \"\"\nfor i = 1, 10000 do\n    out = out .. \"piece\" .. i .. \",\"\nend\n\n-- Fast: collect parts, then join once\nlocal parts = {}\nfor i = 1, 10000 do\n    parts[#parts + 1] = \"piece\"\n    parts[#parts + 1] = tostring(i)\n    parts[#parts + 1] = \",\"\nend\nlocal out2 = table.concat(parts)\n```\nReason: `table.concat` builds the final string in one pass, avoiding the repeated intermediate allocations and copies caused by `..` in a loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-drawrect.v1","fixtureId":"gmod.perf.surface-drawrect.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"696e8de769d9ad0e","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3987,"startedAt":"2026-07-10T17:26:30.591Z","completedAt":"2026-07-10T17:26:34.579Z","answerBytes":190,"answerChars":190,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":69,"completionTokens":48,"totalTokens":117,"source":"estimated"},"finalResponse":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` skips the rounded-box path and is the lighter direct rectangle draw for non-rounded fills.","model_patch":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` skips the rounded-box path and is the lighter direct rectangle draw for non-rounded fills."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-text.v1","fixtureId":"gmod.perf.surface-text.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"95d9fe4918ee4197","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6090,"startedAt":"2026-07-10T17:26:31.062Z","completedAt":"2026-07-10T17:26:37.153Z","answerBytes":473,"answerChars":473,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":119,"totalTokens":195,"source":"estimated"},"finalResponse":"```lua\nlocal fontName = \"HudHintTextLarge\"\nlocal text = \"Hello world\"\nlocal x, y = 100, 100\n\nsurface.SetFont(fontName)\nsurface.SetTextColor(255, 255, 255, 255)\nsurface.SetTextPos(x, y)\nsurface.DrawText(text)\n``` \nReason: `surface.SetFont` + `surface.SetTextPos` + `surface.SetTextColor` + `surface.DrawText` is the lightest option here; it avoids the extra layout/shadow/outline work and higher-level wrapper overhead in `draw.DrawText` and especially `SimpleTextOutlined`.","model_patch":"```lua\nlocal fontName = \"HudHintTextLarge\"\nlocal text = \"Hello world\"\nlocal x, y = 100, 100\n\nsurface.SetFont(fontName)\nsurface.SetTextColor(255, 255, 255, 255)\nsurface.SetTextPos(x, y)\nsurface.DrawText(text)\n``` \nReason: `surface.SetFont` + `surface.SetTextPos` + `surface.SetTextColor` + `surface.DrawText` is the lightest option here; it avoids the extra layout/shadow/outline work and higher-level wrapper overhead in `draw.DrawText` and especially `SimpleTextOutlined`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-count-hash.v1","fixtureId":"gmod.perf.table-count-hash.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3e9bbfc8452e05e3","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3183,"startedAt":"2026-07-10T17:26:31.222Z","completedAt":"2026-07-10T17:26:34.406Z","answerBytes":129,"answerChars":129,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":33,"totalTokens":95,"source":"estimated"},"finalResponse":"```lua\nlocal n = #t\n```\nReason: `#` is the preferred operator for the length of a sequential array-like table in Garry's Mod Lua.","model_patch":"```lua\nlocal n = #t\n```\nReason: `#` is the preferred operator for the length of a sequential array-like table in Garry's Mod Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-empty.v1","fixtureId":"gmod.perf.table-empty.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3a6344977f5bd475","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7181,"startedAt":"2026-07-10T17:26:31.642Z","completedAt":"2026-07-10T17:26:38.824Z","answerBytes":437,"answerChars":437,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":110,"totalTokens":183,"source":"estimated"},"finalResponse":"```lua\n-- Fastest when you only need to discard the old contents and do not need\n-- other references to see the cleared table.\nt = {}\n\n-- Use table.Empty(t) only when you must keep the same table object\n-- for existing references.\n``` \nReason: `t = {}` usually wins for repeatedly discarding a large table because it avoids walking and clearing every slot; `table.Empty(t)` only helps when you must preserve the original table reference.","model_patch":"```lua\n-- Fastest when you only need to discard the old contents and do not need\n-- other references to see the cleared table.\nt = {}\n\n-- Use table.Empty(t) only when you must keep the same table object\n-- for existing references.\n``` \nReason: `t = {}` usually wins for repeatedly discarding a large table because it avoids walking and clearing every slot; `table.Empty(t)` only helps when you must preserve the original table reference."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-hasvalue.v1","fixtureId":"gmod.perf.table-hasvalue.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7d064428a873fdfc","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5563,"startedAt":"2026-07-10T17:26:31.798Z","completedAt":"2026-07-10T17:26:37.362Z","answerBytes":258,"answerChars":258,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":67,"completionTokens":65,"totalTokens":132,"source":"estimated"},"finalResponse":"```lua\nlocal set = {\n    apple = true,\n    banana = true,\n    cherry = true,\n}\n\nif set[item] then\n    -- item exists in the set\nend\n```\nReason: A keyed lookup is O(1) on average, while `table.HasValue` scans a list linearly and gets slower as the list grows.","model_patch":"```lua\nlocal set = {\n    apple = true,\n    banana = true,\n    cherry = true,\n}\n\nif set[item] then\n    -- item exists in the set\nend\n```\nReason: A keyed lookup is O(1) on average, while `table.HasValue` scans a list linearly and gets slower as the list grows."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-literal.v1","fixtureId":"gmod.perf.table-literal.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f95a8fc610d720ad","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4939,"startedAt":"2026-07-10T17:26:32.342Z","completedAt":"2026-07-10T17:26:37.283Z","answerBytes":414,"answerChars":414,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":104,"totalTokens":174,"source":"estimated"},"finalResponse":"```lua\n-- Faster / smaller: use the table constructor when fields are known up front.\nlocal t = { x = 1, y = 2, z = 3 }\n\n-- Slower: create empty table, then assign fields.\nlocal u = {}\nu.x = 1\nu.y = 2\nu.z = 3\n```\nReason: The constructor does the allocation and field initialization in one step, while separate assignments add extra writes and lookups; for a small known table, the constructor is the faster choice.","model_patch":"```lua\n-- Faster / smaller: use the table constructor when fields are known up front.\nlocal t = { x = 1, y = 2, z = 3 }\n\n-- Slower: create empty table, then assign fields.\nlocal u = {}\nu.x = 1\nu.y = 2\nu.z = 3\n```\nReason: The constructor does the allocation and field initialization in one step, while separate assignments add extra writes and lookups; for a small known table, the constructor is the faster choice."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-random.v1","fixtureId":"gmod.perf.table-random.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f3e090701953d4a9","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3451,"startedAt":"2026-07-10T17:26:32.799Z","completedAt":"2026-07-10T17:26:36.252Z","answerBytes":209,"answerChars":209,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":53,"totalTokens":119,"source":"estimated"},"finalResponse":"```lua\nlocal t = {\"a\", \"b\", \"c\", \"d\"}\nlocal value = t[math.random(#t)]\n``` \nReason: For a sequential table, indexing directly with `math.random(#t)` avoids `table.Random`'s extra table iteration and is faster.","model_patch":"```lua\nlocal t = {\"a\", \"b\", \"c\", \"d\"}\nlocal value = t[math.random(#t)]\n``` \nReason: For a sequential table, indexing directly with `math.random(#t)` avoids `table.Random`'s extra table iteration and is faster."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.x-times-x.v1","fixtureId":"gmod.perf.x-times-x.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"79d48008f6b5174f","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":2983,"startedAt":"2026-07-10T17:26:32.980Z","completedAt":"2026-07-10T17:26:35.964Z","answerBytes":155,"answerChars":155,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":58,"completionTokens":39,"totalTokens":97,"source":"estimated"},"finalResponse":"```lua\nlocal y = x * x\n```\nReason: `x * x` is the direct square operation and is faster and clearer than calling `math.pow` or `x ^ 2` in a tight Lua loop.","model_patch":"```lua\nlocal y = x * x\n```\nReason: `x * x` is the direct square operation and is faster and clearer than calling `math.pow` or `x ^ 2` in a tight Lua loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.player-iterator.v1","fixtureId":"gmod.player-iterator.v1","fixtureVersion":2,"rubricVersion":"4","promptHash":"fe3d7469535a0ca2","adapterId":"codex","model":"gpt-5.4-mini@low","model_name_or_path":"gpt-5.4-mini@low","attemptIndex":1,"status":"incorrect","detail":"The recommendation changes the set of visited players.","durationMs":3564,"startedAt":"2026-07-10T17:26:33.384Z","completedAt":"2026-07-10T17:26:36.951Z","answerBytes":221,"answerChars":221,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":80,"completionTokens":56,"totalTokens":136,"source":"estimated"},"finalResponse":"```lua\nfor _, ply in ipairs(player.GetHumans()) do\n    -- your code here\nend\n```\nReason: `player.GetHumans()` returns the currently connected human players, and `ipairs` is the idiomatic way to iterate that list in order.","model_patch":"```lua\nfor _, ply in ipairs(player.GetHumans()) do\n    -- your code here\nend\n```\nReason: `player.GetHumans()` returns the currently connected human players, and `ipairs` is the idiomatic way to iterate that list in order."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.ents-iterator.v1","fixtureId":"gmod.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"3990c92253db85bb","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6304,"startedAt":"2026-07-10T17:26:33.481Z","completedAt":"2026-07-10T17:26:39.786Z","answerBytes":266,"answerChars":266,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":72,"completionTokens":67,"totalTokens":139,"source":"estimated"},"finalResponse":"```lua\nfor ent in ents.Iterator() do\n    if IsValid(ent) and ent:GetClass() == \"prop_physics\" then\n        -- do something with ent\n    end\nend\n```\nReason: `ents.Iterator()` yields entities lazily, so it scans the map without first materializing a full entity table.","model_patch":"```lua\nfor ent in ents.Iterator() do\n    if IsValid(ent) and ent:GetClass() == \"prop_physics\" then\n        -- do something with ent\n    end\nend\n```\nReason: `ents.Iterator()` yields entities lazily, so it scans the map without first materializing a full entity table."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.hook-add.v1","fixtureId":"gmod.hook-add.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"12d2222fdb7d6b90","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Registers a named hook with hook.Add.","durationMs":4727,"startedAt":"2026-07-10T17:26:33.634Z","completedAt":"2026-07-10T17:26:38.363Z","answerBytes":193,"answerChars":193,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":78,"completionTokens":49,"totalTokens":127,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- Think callback\nend)\n```\nReason: `hook.Add` registers the callback on Garry's Mod's `Think` hook under the identifier `MyAddon.Think`.","model_patch":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\n    -- Think callback\nend)\n```\nReason: `hook.Add` registers the callback on Garry's Mod's `Think` hook under the identifier `MyAddon.Think`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.isvalid.v1","fixtureId":"gmod.isvalid.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"35527312e59dfc13","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Uses IsValid for entity/object validity.","durationMs":5499,"startedAt":"2026-07-10T17:26:33.804Z","completedAt":"2026-07-10T17:26:39.305Z","answerBytes":203,"answerChars":203,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":74,"completionTokens":51,"totalTokens":125,"source":"estimated"},"finalResponse":"```lua\nif not IsValid(ent) then return end\n```\nReason: `IsValid(ent)` is the standard Garry's Mod check for whether an entity reference still points to a live, usable entity before calling methods on it.","model_patch":"```lua\nif not IsValid(ent) then return end\n```\nReason: `IsValid(ent)` is the standard Garry's Mod check for whether an entity reference still points to a live, usable entity before calling methods on it."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.net-receivers.v1","fixtureId":"gmod.net-receivers.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"24d54ee8366753a6","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5135,"startedAt":"2026-07-10T17:26:34.020Z","completedAt":"2026-07-10T17:26:39.157Z","answerBytes":201,"answerChars":201,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":64,"completionTokens":51,"totalTokens":115,"source":"estimated"},"finalResponse":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle the message here\nend)\n```\nReason: `net.Receive` is the Garry's Mod API for registering a handler for an incoming net message by name.","model_patch":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle the message here\nend)\n```\nReason: `net.Receive` is the Garry's Mod API for registering a handler for an incoming net message by name."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.angle-zero.v1","fixtureId":"gmod.perf.angle-zero.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f6bc97bf98280d62","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain exactly one fenced code block followed by a reason.","durationMs":16956,"startedAt":"2026-07-10T17:26:34.407Z","completedAt":"2026-07-10T17:26:51.364Z","answerBytes":367,"answerChars":367,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":16630,"completionTokens":877,"totalTokens":17507,"reasoningTokens":762,"cachedTokens":1536},"finalResponse":"```lua\n-- Slow: allocates a new Angle every call.\nlocal function makeZeroAngle_slow()\n    return Angle()\nend\n\n-- Faster in a hot path: reuse one scratch Angle and reset it.\n-- Only use this when the caller consumes it immediately and does not keep it.\nlocal ZERO_ANGLE = Angle()\n\nlocal function makeZeroAngle_fast()\n    ZERO_ANGLE:Zero()\n    return ZERO_ANGLE\nend\n```","model_patch":"```lua\n-- Slow: allocates a new Angle every call.\nlocal function makeZeroAngle_slow()\n    return Angle()\nend\n\n-- Faster in a hot path: reuse one scratch Angle and reset it.\n-- Only use this when the caller consumes it immediately and does not keep it.\nlocal ZERO_ANGLE = Angle()\n\nlocal function makeZeroAngle_fast()\n    ZERO_ANGLE:Zero()\n    return ZERO_ANGLE\nend\n```"}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.config-var.v1","fixtureId":"gmod.perf.config-var.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"bcc4ff8eb162b699","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6613,"startedAt":"2026-07-10T17:26:34.488Z","completedAt":"2026-07-10T17:26:41.103Z","answerBytes":183,"answerChars":183,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":82,"completionTokens":46,"totalTokens":128,"source":"estimated"},"finalResponse":"```lua\nlocal myaddon_color = Color(255, 0, 0)\n\nlocal c = myaddon_color\n```\nReason: A flat local is faster to read than `myaddon.config.color` because it avoids repeated table lookups.","model_patch":"```lua\nlocal myaddon_color = Color(255, 0, 0)\n\nlocal c = myaddon_color\n```\nReason: A flat local is faster to read than `myaddon.config.color` because it avoids repeated table lookups."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.darkrpvar.v1","fixtureId":"gmod.perf.darkrpvar.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"02a37daa699cded3","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5505,"startedAt":"2026-07-10T17:26:34.581Z","completedAt":"2026-07-10T17:26:40.090Z","answerBytes":200,"answerChars":200,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":50,"totalTokens":116,"source":"estimated"},"finalResponse":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n```\nReason: DarkRP exposes the job label through `getDarkRPVar(\"job\")`; `NWString(\"job\")` is an internal networked variable and is not the preferred API.","model_patch":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n```\nReason: DarkRP exposes the job label through `getDarkRPVar(\"job\")`; `NWString(\"job\")` is an internal networked variable and is not the preferred API."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.disttosqr.v1","fixtureId":"gmod.perf.disttosqr.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a5772470c6859cdc","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":3880,"startedAt":"2026-07-10T17:26:35.266Z","completedAt":"2026-07-10T17:26:39.148Z","answerBytes":202,"answerChars":202,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":51,"totalTokens":122,"source":"estimated"},"finalResponse":"```lua\nif vec1:DistToSqr(vec2) <= threshold * threshold then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root and is the right choice when you only need a distance threshold check.","model_patch":"```lua\nif vec1:DistToSqr(vec2) <= threshold * threshold then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root and is the right choice when you only need a distance threshold check."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ents-iterator.v1","fixtureId":"gmod.perf.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"306d3f1d05f28246","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":8815,"startedAt":"2026-07-10T17:26:35.553Z","completedAt":"2026-07-10T17:26:44.369Z","answerBytes":206,"answerChars":206,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":52,"totalTokens":118,"source":"estimated"},"finalResponse":"```lua\nfor ent in ents.Iterator() do\n    -- visit every entity here\nend\n```\nReason: `ents.Iterator()` is the wiki-recommended efficient iterator for walking all entities without building a full table first.","model_patch":"```lua\nfor ent in ents.Iterator() do\n    -- visit every entity here\nend\n```\nReason: `ents.Iterator()` is the wiki-recommended efficient iterator for walking all entities without building a full table first."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-ents-near.v1","fixtureId":"gmod.perf.find-ents-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"07c583fc3d9fe09f","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":7801,"startedAt":"2026-07-10T17:26:35.656Z","completedAt":"2026-07-10T17:26:43.458Z","answerBytes":354,"answerChars":350,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14560,"completionTokens":322,"totalTokens":14882,"reasoningTokens":208,"cachedTokens":13824},"finalResponse":"```lua\nlocal pos = ply:GetPos()\nlocal radius = 256\nlocal entsNear = ents.FindInSphere(pos, radius)\n\nfor _, ent in ipairs(entsNear) do\n    -- process ent\nend\n``` \nReason: `ents.FindInSphere` is a fast built-in broadphase query for “near a player” checks and is usually the simplest performant choice when you do not need the extra cost of `FindInPVS`.","model_patch":"```lua\nlocal pos = ply:GetPos()\nlocal radius = 256\nlocal entsNear = ents.FindInSphere(pos, radius)\n\nfor _, ent in ipairs(entsNear) do\n    -- process ent\nend\n``` \nReason: `ents.FindInSphere` is a fast built-in broadphase query for “near a player” checks and is usually the simplest performant choice when you do not need the extra cost of `FindInPVS`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-players-near.v1","fixtureId":"gmod.perf.find-players-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d139ba2e8ee38a2f","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14581,"startedAt":"2026-07-10T17:26:35.965Z","completedAt":"2026-07-10T17:26:50.547Z","answerBytes":467,"answerChars":467,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":117,"totalTokens":196,"source":"estimated"},"finalResponse":"```lua\nlocal function PlayersInSphere(pos, radius)\n    local radiusSqr = radius * radius\n    local out = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if ply:Alive() and ply:GetPos():DistToSqr(pos) <= radiusSqr then\n            out[#out + 1] = ply\n        end\n    end\n\n    return out\nend\n``` \nReason: `player.GetAll()` skips scanning every entity, and `DistToSqr` avoids the square root cost of `Distance`, which is faster when you only care about players.","model_patch":"```lua\nlocal function PlayersInSphere(pos, radius)\n    local radiusSqr = radius * radius\n    local out = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if ply:Alive() and ply:GetPos():DistToSqr(pos) <= radiusSqr then\n            out[#out + 1] = ply\n        end\n    end\n\n    return out\nend\n``` \nReason: `player.GetAll()` skips scanning every entity, and `DistToSqr` avoids the square root cost of `Distance`, which is faster when you only care about players."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.for-vs-while.v1","fixtureId":"gmod.perf.for-vs-while.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b3401a190a8aecf0","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":17370,"startedAt":"2026-07-10T17:26:36.253Z","completedAt":"2026-07-10T17:26:53.624Z","answerBytes":210,"answerChars":210,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":65,"completionTokens":53,"totalTokens":118,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, n do\n    -- tight counting loop\nend\n```\nReason: A numeric `for` loop is generally faster than `while` in Garry's Mod Lua because it is a built-in counted loop with less per-iteration overhead.","model_patch":"```lua\nfor i = 1, n do\n    -- tight counting loop\nend\n```\nReason: A numeric `for` loop is generally faster than `while` in Garry's Mod Lua because it is a built-in counted loop with less per-iteration overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hook-once.v1","fixtureId":"gmod.perf.hook-once.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ed1d3e09249fc8bb","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5565,"startedAt":"2026-07-10T17:26:36.358Z","completedAt":"2026-07-10T17:26:41.924Z","answerBytes":245,"answerChars":245,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":84,"completionTokens":62,"totalTokens":146,"source":"estimated"},"finalResponse":"```lua\nlocal players = player.GetAll()\n\nhook.Run(\"MyCustomTick\", players)\n```\nReason: one hook dispatch per tick is cheaper than one hook dispatch per player, because it avoids repeated hook lookup, argument packing, and Lua/C boundary overhead.","model_patch":"```lua\nlocal players = player.GetAll()\n\nhook.Run(\"MyCustomTick\", players)\n```\nReason: one hook dispatch per tick is cheaper than one hook dispatch per player, because it avoids repeated hook lookup, argument packing, and Lua/C boundary overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hudpaint-cache.v1","fixtureId":"gmod.perf.hudpaint-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3def450f3158ceff","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":8267,"startedAt":"2026-07-10T17:26:36.952Z","completedAt":"2026-07-10T17:26:45.221Z","answerBytes":512,"answerChars":512,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":128,"totalTokens":204,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"HUDPaint\", \"MyHUD\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    local hp = lp:Health()\n\n    draw.SimpleText(hp, \"DermaDefault\", 20, 20, color_white)\n    draw.SimpleText(\"HP: \" .. hp, \"DermaDefault\", 20, 40, color_white)\n    draw.SimpleText(math.Clamp(hp, 0, 100), \"DermaDefault\", 20, 60, color_white)\nend)\n```\nReason: `LocalPlayer():Health()` is computed once per frame and reused, so the hook avoids repeating the same lookup and method call three times.","model_patch":"```lua\nhook.Add(\"HUDPaint\", \"MyHUD\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    local hp = lp:Health()\n\n    draw.SimpleText(hp, \"DermaDefault\", 20, 20, color_white)\n    draw.SimpleText(\"HP: \" .. hp, \"DermaDefault\", 20, 40, color_white)\n    draw.SimpleText(math.Clamp(hp, 0, 100), \"DermaDefault\", 20, 60, color_white)\nend)\n```\nReason: `LocalPlayer():Health()` is computed once per frame and reused, so the hook avoids repeating the same lookup and method call three times."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-color.v1","fixtureId":"gmod.perf.local-color.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"16a7bed1b931d467","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4921,"startedAt":"2026-07-10T17:26:37.153Z","completedAt":"2026-07-10T17:26:42.076Z","answerBytes":265,"answerChars":265,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":67,"totalTokens":130,"source":"estimated"},"finalResponse":"```lua\nlocal WHITE = Color(255, 255, 255)\n\nfor i = 1, n do\n    surface.SetDrawColor(WHITE)\n    -- paint work\nend\n```\nReason: `Color(255, 255, 255)` allocates or looks up a color object each pass; hoisting one shared white color avoids repeated work in the hot loop.","model_patch":"```lua\nlocal WHITE = Color(255, 255, 255)\n\nfor i = 1, n do\n    surface.SetDrawColor(WHITE)\n    -- paint work\nend\n```\nReason: `Color(255, 255, 255)` allocates or looks up a color object each pass; hoisting one shared white color avoids repeated work in the hot loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-vs-global.v1","fixtureId":"gmod.perf.local-vs-global.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"c116d8c651190647","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4847,"startedAt":"2026-07-10T17:26:37.284Z","completedAt":"2026-07-10T17:26:42.132Z","answerBytes":169,"answerChars":169,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":43,"totalTokens":105,"source":"estimated"},"finalResponse":"```lua\nlocal sin = math.sin\n\nfor i = 1, n do\n    local v = sin(i)\n    -- use v\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table lookups in a hot loop.","model_patch":"```lua\nlocal sin = math.sin\n\nfor i = 1, n do\n    local v = sin(i)\n    -- use v\nend\n```\nReason: Caching `math.sin` in a local avoids repeated table lookups in a hot loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.localplayer-cache.v1","fixtureId":"gmod.perf.localplayer-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7398105af47b079e","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":8949,"startedAt":"2026-07-10T17:26:37.363Z","completedAt":"2026-07-10T17:26:46.316Z","answerBytes":293,"answerChars":293,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":74,"totalTokens":144,"source":"estimated"},"finalResponse":"```lua\nlocal LocalPlayer = LocalPlayer\n\nhook.Add(\"HUDPaint\", \"MyFastCheck\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    -- use lp here\nend)\n``` \nReason: `LocalPlayer` is resolved once into a local upvalue, so repeated calls skip the global table lookup.","model_patch":"```lua\nlocal LocalPlayer = LocalPlayer\n\nhook.Add(\"HUDPaint\", \"MyFastCheck\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    -- use lp here\nend)\n``` \nReason: `LocalPlayer` is resolved once into a local upvalue, so repeated calls skip the global table lookup."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.looking-at.v1","fixtureId":"gmod.perf.looking-at.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"20b22f678a4b08d7","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":21420,"startedAt":"2026-07-10T17:26:38.363Z","completedAt":"2026-07-10T17:26:59.785Z","answerBytes":685,"answerChars":685,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":91,"completionTokens":172,"totalTokens":263,"source":"estimated"},"finalResponse":"```lua\nlocal LOOK_DOT = 0.94 -- about a 20 degree cone; tune as needed\n\nlocal function ArePlayersLookingAtEachOther(plyA, plyB)\n    if not IsValid(plyA) or not IsValid(plyB) then return false end\n\n    local aPos = plyA:EyePos()\n    local bPos = plyB:EyePos()\n\n    local aToB = bPos - aPos\n    local bToA = aPos - bPos\n\n    if aToB:LengthSqr() == 0 or bToA:LengthSqr() == 0 then return false end\n\n    aToB:Normalize()\n    bToA:Normalize()\n\n    return plyA:GetAimVector():Dot(aToB) >= LOOK_DOT\n       and plyB:GetAimVector():Dot(bToA) >= LOOK_DOT\nend\n``` \nReason: Dot products give the same facing test as an angle check without `math.acos`, so this is cheaper and fast for per-tick use.","model_patch":"```lua\nlocal LOOK_DOT = 0.94 -- about a 20 degree cone; tune as needed\n\nlocal function ArePlayersLookingAtEachOther(plyA, plyB)\n    if not IsValid(plyA) or not IsValid(plyB) then return false end\n\n    local aPos = plyA:EyePos()\n    local bPos = plyB:EyePos()\n\n    local aToB = bPos - aPos\n    local bToA = aPos - bPos\n\n    if aToB:LengthSqr() == 0 or bToA:LengthSqr() == 0 then return false end\n\n    aToB:Normalize()\n    bToA:Normalize()\n\n    return plyA:GetAimVector():Dot(aToB) >= LOOK_DOT\n       and plyB:GetAimVector():Dot(bToA) >= LOOK_DOT\nend\n``` \nReason: Dot products give the same facing test as an angle check without `math.acos`, so this is cheaper and fast for per-tick use."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.meta-vs-arg.v1","fixtureId":"gmod.perf.meta-vs-arg.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de332f7356830dfa","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":9692,"startedAt":"2026-07-10T17:26:38.824Z","completedAt":"2026-07-10T17:26:48.517Z","answerBytes":247,"answerChars":247,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":62,"totalTokens":133,"source":"estimated"},"finalResponse":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally faster for a helper you control because it avoids the method lookup and colon-call sugar overhead; the difference is usually small, but the direct function call is the cheaper path.","model_patch":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally faster for a helper you control because it avoids the method lookup and colon-call sugar overhead; the difference is usually small, but the direct function call is the cheaper path."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.msg-vs-print.v1","fixtureId":"gmod.perf.msg-vs-print.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"6cbb4e4b2f19dd24","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":8732,"startedAt":"2026-07-10T17:26:39.148Z","completedAt":"2026-07-10T17:26:47.881Z","answerBytes":123,"answerChars":123,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":31,"totalTokens":94,"source":"estimated"},"finalResponse":"```lua\nMsgN(\"debug: \", value)\n```\nReason: `MsgN` writes straight to the console with less formatting overhead than `print`.","model_patch":"```lua\nMsgN(\"debug: \", value)\n```\nReason: `MsgN` writes straight to the console with less formatting overhead than `print`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.pairs-ipairs-for.v1","fixtureId":"gmod.perf.pairs-ipairs-for.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de5e4875fcf3e600","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4119,"startedAt":"2026-07-10T17:26:39.158Z","completedAt":"2026-07-10T17:26:43.278Z","answerBytes":254,"answerChars":254,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":64,"totalTokens":137,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, #t do\n    local v = t[i]\n    -- use v\nend\n```\nReason: `numeric for` is typically fastest for a large sequential array-like table because it avoids iterator overhead; `ipairs` is slower and `pairs` is the least suitable for dense arrays.","model_patch":"```lua\nfor i = 1, #t do\n    local v = t[i]\n    -- use v\nend\n```\nReason: `numeric for` is typically fastest for a large sequential array-like table because it avoids iterator overhead; `ipairs` is slower and `pairs` is the least suitable for dense arrays."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.plain-lua-vs-fn.v1","fixtureId":"gmod.perf.plain-lua-vs-fn.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ead0a98b3ff6a388","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":31117,"startedAt":"2026-07-10T17:26:39.306Z","completedAt":"2026-07-10T17:27:10.424Z","answerBytes":620,"answerChars":620,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":155,"totalTokens":231,"source":"estimated"},"finalResponse":"```lua\nlocal function filter_map(list, pred, map)\n  local out = {}\n  local n = 0\n\n  for i = 1, #list do\n    local v = list[i]\n    if pred(v, i) then\n      n = n + 1\n      out[n] = map(v, i)\n    end\n  end\n\n  return out\nend\n\n-- Example: DarkRP-style list work, but fused into one pass.\nlocal names = filter_map(players.GetAll(), function(p)\n  return IsValid(p) and p:Alive() and not p:isArrested()\nend, function(p)\n  return p:Nick()\nend)\n``` \nReason: One numeric for-loop, no intermediate tables, no combinator chaining, and no `table.insert` overhead; that is less allocation and fewer Lua calls than a small fn pipeline.","model_patch":"```lua\nlocal function filter_map(list, pred, map)\n  local out = {}\n  local n = 0\n\n  for i = 1, #list do\n    local v = list[i]\n    if pred(v, i) then\n      n = n + 1\n      out[n] = map(v, i)\n    end\n  end\n\n  return out\nend\n\n-- Example: DarkRP-style list work, but fused into one pass.\nlocal names = filter_map(players.GetAll(), function(p)\n  return IsValid(p) and p:Alive() and not p:isArrested()\nend, function(p)\n  return p:Nick()\nend)\n``` \nReason: One numeric for-loop, no intermediate tables, no combinator chaining, and no `table.insert` overhead; that is less allocation and fewer Lua calls than a small fn pipeline."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.player-cache-hooks.v1","fixtureId":"gmod.perf.player-cache-hooks.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a834817afe9e6c25","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6514,"startedAt":"2026-07-10T17:26:39.787Z","completedAt":"2026-07-10T17:26:46.302Z","answerBytes":720,"answerChars":720,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":88,"completionTokens":180,"totalTokens":268,"source":"estimated"},"finalResponse":"```lua\nlocal cachedPlayers = player.GetAll()\n\nhook.Add(\"PlayerInitialSpawn\", \"RefreshCachedPlayersJoin\", function(ply)\n    cachedPlayers[#cachedPlayers + 1] = ply\nend)\n\nhook.Add(\"PlayerDisconnected\", \"RefreshCachedPlayersLeave\", function(ply)\n    for i = #cachedPlayers, 1, -1 do\n        if cachedPlayers[i] == ply then\n            table.remove(cachedPlayers, i)\n            break\n        end\n    end\nend)\n\nhook.Add(\"Tick\", \"UseCachedPlayers\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n        -- work with ply\n    end\nend)\n``` \nReason: `player.GetAll()` allocates and rebuilds the full player list every tick; caching it and updating only on join/leave removes that repeated work.","model_patch":"```lua\nlocal cachedPlayers = player.GetAll()\n\nhook.Add(\"PlayerInitialSpawn\", \"RefreshCachedPlayersJoin\", function(ply)\n    cachedPlayers[#cachedPlayers + 1] = ply\nend)\n\nhook.Add(\"PlayerDisconnected\", \"RefreshCachedPlayersLeave\", function(ply)\n    for i = #cachedPlayers, 1, -1 do\n        if cachedPlayers[i] == ply then\n            table.remove(cachedPlayers, i)\n            break\n        end\n    end\nend)\n\nhook.Add(\"Tick\", \"UseCachedPlayers\", function()\n    for i = 1, #cachedPlayers do\n        local ply = cachedPlayers[i]\n        -- work with ply\n    end\nend)\n``` \nReason: `player.GetAll()` allocates and rebuilds the full player list every tick; caching it and updating only on join/leave removes that repeated work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ply-table-index.v1","fixtureId":"gmod.perf.ply-table-index.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f18cc80df8999147","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13329,"startedAt":"2026-07-10T17:26:40.090Z","completedAt":"2026-07-10T17:26:53.421Z","answerBytes":575,"answerChars":575,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":69,"completionTokens":144,"totalTokens":213,"source":"estimated"},"finalResponse":"```lua\nlocal PlayerData = setmetatable({}, { __mode = \"k\" }) -- weak keys; entries vanish when player entity is gone\n\nlocal function GetPlayerData(ply)\n    local data = PlayerData[ply]\n    if data == nil then\n        data = {}\n        PlayerData[ply] = data\n    end\n    return data\nend\n\n-- write\nlocal data = GetPlayerData(ply)\ndata.tempScore = 123\n\n-- hot reads\nlocal score = GetPlayerData(ply).tempScore\n``` \nReason: a plain Lua table keyed by the player entity avoids repeated entity-field lookup, and hot code can keep the returned data table in a local for faster reads.","model_patch":"```lua\nlocal PlayerData = setmetatable({}, { __mode = \"k\" }) -- weak keys; entries vanish when player entity is gone\n\nlocal function GetPlayerData(ply)\n    local data = PlayerData[ply]\n    if data == nil then\n        data = {}\n        PlayerData[ply] = data\n    end\n    return data\nend\n\n-- write\nlocal data = GetPlayerData(ply)\ndata.tempScore = 123\n\n-- hot reads\nlocal score = GetPlayerData(ply).tempScore\n``` \nReason: a plain Lua table keyed by the player entity avoids repeated entity-field lookup, and hot code can keep the returned data table in a local for faster reads."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.seq-tables.v1","fixtureId":"gmod.perf.seq-tables.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4778b0220c3f91a3","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6770,"startedAt":"2026-07-10T17:26:41.104Z","completedAt":"2026-07-10T17:26:47.876Z","answerBytes":296,"answerChars":296,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":74,"totalTokens":153,"source":"estimated"},"finalResponse":"```lua\nlocal values = {\n  \"alpha\",\n  \"beta\",\n  \"gamma\",\n  \"delta\",\n}\n\nfor i = 1, #values do\n  local v = values[i]\n  -- use v\nend\n``` \nReason: Sequential number-indexed arrays are faster to iterate than string-keyed maps because Lua can walk them with dense numeric access instead of hash lookups.","model_patch":"```lua\nlocal values = {\n  \"alpha\",\n  \"beta\",\n  \"gamma\",\n  \"delta\",\n}\n\nfor i = 1, #values do\n  local v = values[i]\n  -- use v\nend\n``` \nReason: Sequential number-indexed arrays are faster to iterate than string-keyed maps because Lua can walk them with dense numeric access instead of hash lookups."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.setdrawcolor-split.v1","fixtureId":"gmod.perf.setdrawcolor-split.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d110fde8a37bbe59","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5005,"startedAt":"2026-07-10T17:26:41.195Z","completedAt":"2026-07-10T17:26:46.201Z","answerBytes":176,"answerChars":176,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":44,"totalTokens":115,"source":"estimated"},"finalResponse":"```lua\nsurface.SetDrawColor(255, 128, 64, 255)\n```\nReason: Passing raw numbers avoids creating or unpacking a `Color` object on a hot draw path, so it is the faster call style.","model_patch":"```lua\nsurface.SetDrawColor(255, 128, 64, 255)\n```\nReason: Passing raw numbers avoids creating or unpacking a `Color` object on a hot draw path, so it is the faster call style."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.sqlite-vs-mysql.v1","fixtureId":"gmod.perf.sqlite-vs-mysql.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4a3f5d2a20d71ac9","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":4530,"startedAt":"2026-07-10T17:26:41.926Z","completedAt":"2026-07-10T17:26:46.457Z","answerBytes":264,"answerChars":264,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":100,"completionTokens":66,"totalTokens":166,"source":"estimated"},"finalResponse":"```lua\nlocal result = sql.QueryValue(\"SELECT money FROM player_data WHERE steamid = \" .. sql.SQLStr(steamID64))\n```\nReason: Local SQLite is typically lower latency for a single GMod server because it avoids network round-trips and remote MySQL connection overhead.","model_patch":"```lua\nlocal result = sql.QueryValue(\"SELECT money FROM player_data WHERE steamid = \" .. sql.SQLStr(steamID64))\n```\nReason: Local SQLite is typically lower latency for a single GMod server because it avoids network round-trips and remote MySQL connection overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.steamid-cache.v1","fixtureId":"gmod.perf.steamid-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"e8a94aa454154982","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":31017,"startedAt":"2026-07-10T17:26:42.077Z","completedAt":"2026-07-10T17:27:13.095Z","answerBytes":573,"answerChars":573,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14543,"completionTokens":522,"totalTokens":15065,"reasoningTokens":353,"cachedTokens":13824},"finalResponse":"```lua\nlocal steamid_cache = setmetatable({}, { __mode = \"k\" }) -- weak keys: entries drop when the player entity disappears\n\nlocal function SteamIDCached(ply)\n    local sid = steamid_cache[ply]\n    if sid ~= nil then\n        return sid\n    end\n\n    sid = ply:SteamID()\n    steamid_cache[ply] = sid\n    return sid\nend\n\n-- hot path usage\n-- local sid = SteamIDCached(ply)\n``` \nReason: `ply:SteamID()` is an expensive repeated lookup here, so a weak-key memoization table returns the same string after the first call per player and lets stale entries fall away automatically.","model_patch":"```lua\nlocal steamid_cache = setmetatable({}, { __mode = \"k\" }) -- weak keys: entries drop when the player entity disappears\n\nlocal function SteamIDCached(ply)\n    local sid = steamid_cache[ply]\n    if sid ~= nil then\n        return sid\n    end\n\n    sid = ply:SteamID()\n    steamid_cache[ply] = sid\n    return sid\nend\n\n-- hot path usage\n-- local sid = SteamIDCached(ply)\n``` \nReason: `ply:SteamID()` is an expensive repeated lookup here, so a weak-key memoization table returns the same string after the first call per player and lets stale entries fall away automatically."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.string-table-concat.v1","fixtureId":"gmod.perf.string-table-concat.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b0cf9e04ae7c5dd9","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":13544,"startedAt":"2026-07-10T17:26:42.133Z","completedAt":"2026-07-10T17:26:55.680Z","answerBytes":517,"answerChars":517,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14544,"completionTokens":306,"totalTokens":14850,"reasoningTokens":121,"cachedTokens":0},"finalResponse":"```lua\n-- Slow: repeated .. rebuilds the string over and over.\nlocal out = \"\"\nfor i = 1, 10000 do\n    out = out .. \"piece\" .. i .. \",\"\nend\n\n-- Fast: collect parts, then join once.\nlocal parts = {}\nfor i = 1, 10000 do\n    parts[#parts + 1] = \"piece\"\n    parts[#parts + 1] = i\n    parts[#parts + 1] = \",\"\nend\n\nlocal out_fast = table.concat(parts)\n``` \nReason: `..` copies the full string each time, so it gets slower as the string grows; `table.concat` builds once from parts and is much faster for thousands of pieces.","model_patch":"```lua\n-- Slow: repeated .. rebuilds the string over and over.\nlocal out = \"\"\nfor i = 1, 10000 do\n    out = out .. \"piece\" .. i .. \",\"\nend\n\n-- Fast: collect parts, then join once.\nlocal parts = {}\nfor i = 1, 10000 do\n    parts[#parts + 1] = \"piece\"\n    parts[#parts + 1] = i\n    parts[#parts + 1] = \",\"\nend\n\nlocal out_fast = table.concat(parts)\n``` \nReason: `..` copies the full string each time, so it gets slower as the string grows; `table.concat` builds once from parts and is much faster for thousands of pieces."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-drawrect.v1","fixtureId":"gmod.perf.surface-drawrect.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"696e8de769d9ad0e","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13269,"startedAt":"2026-07-10T17:26:43.279Z","completedAt":"2026-07-10T17:26:56.549Z","answerBytes":237,"answerChars":237,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14546,"completionTokens":250,"totalTokens":14796,"reasoningTokens":169,"cachedTokens":13824},"finalResponse":"```lua\nsurface.SetDrawColor(color)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `draw.RoundedBox(0, ...)` does extra rounded-box plumbing; `surface.DrawRect` is the direct filled-rectangle draw call and is a bit cheaper for plain rectangles.","model_patch":"```lua\nsurface.SetDrawColor(color)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `draw.RoundedBox(0, ...)` does extra rounded-box plumbing; `surface.DrawRect` is the direct filled-rectangle draw call and is a bit cheaper for plain rectangles."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-text.v1","fixtureId":"gmod.perf.surface-text.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"95d9fe4918ee4197","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":21969,"startedAt":"2026-07-10T17:26:43.459Z","completedAt":"2026-07-10T17:27:05.430Z","answerBytes":446,"answerChars":446,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14547,"completionTokens":427,"totalTokens":14974,"reasoningTokens":282,"cachedTokens":0},"finalResponse":"```lua\nlocal font = \"MyFont\"\nlocal text = \"Hello, world\"\nlocal x, y = 100, 100\nlocal color = color_white\n\nsurface.SetFont(font)\nsurface.SetTextColor(color)\nsurface.SetTextPos(x, y)\nsurface.DrawText(text)\n``` \nReason: `surface.SetFont` + `surface.SetTextPos` + `surface.SetTextColor` + `surface.DrawText` is the leanest path for a single line; `draw.DrawText` and especially `SimpleTextOutlined` do extra layout/alignment/outline work every frame.","model_patch":"```lua\nlocal font = \"MyFont\"\nlocal text = \"Hello, world\"\nlocal x, y = 100, 100\nlocal color = color_white\n\nsurface.SetFont(font)\nsurface.SetTextColor(color)\nsurface.SetTextPos(x, y)\nsurface.DrawText(text)\n``` \nReason: `surface.SetFont` + `surface.SetTextPos` + `surface.SetTextColor` + `surface.DrawText` is the leanest path for a single line; `draw.DrawText` and especially `SimpleTextOutlined` do extra layout/alignment/outline work every frame."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-count-hash.v1","fixtureId":"gmod.perf.table-count-hash.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3e9bbfc8452e05e3","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":45198,"startedAt":"2026-07-10T17:26:44.370Z","completedAt":"2026-07-10T17:27:29.569Z","answerBytes":107,"answerChars":107,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14537,"completionTokens":152,"totalTokens":14689,"reasoningTokens":107,"cachedTokens":13824},"finalResponse":"```lua\nlocal len = #t\n```\nReason: `#` is the standard Lua length operator for sequential array-like tables.","model_patch":"```lua\nlocal len = #t\n```\nReason: `#` is the standard Lua length operator for sequential array-like tables."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-empty.v1","fixtureId":"gmod.perf.table-empty.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3a6344977f5bd475","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":15481,"startedAt":"2026-07-10T17:26:45.222Z","completedAt":"2026-07-10T17:27:00.705Z","answerBytes":342,"answerChars":342,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14548,"completionTokens":242,"totalTokens":14790,"reasoningTokens":143,"cachedTokens":13824},"finalResponse":"```lua\n-- Faster when you can replace the reference:\nt = {}\n\n-- Use table.Empty(t) only when you must keep the same table object.\n``` \nReason: `t = {}` is generally faster because it allocates a new empty table instead of clearing every key in the old one; `table.Empty(t)` mutates the existing table and is typically slower for large tables.","model_patch":"```lua\n-- Faster when you can replace the reference:\nt = {}\n\n-- Use table.Empty(t) only when you must keep the same table object.\n``` \nReason: `t = {}` is generally faster because it allocates a new empty table instead of clearing every key in the old one; `table.Empty(t)` mutates the existing table and is typically slower for large tables."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-hasvalue.v1","fixtureId":"gmod.perf.table-hasvalue.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7d064428a873fdfc","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":19098,"startedAt":"2026-07-10T17:26:46.202Z","completedAt":"2026-07-10T17:27:05.301Z","answerBytes":283,"answerChars":283,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14544,"completionTokens":181,"totalTokens":14725,"reasoningTokens":72,"cachedTokens":13824},"finalResponse":"```lua\nlocal allowed = {\n    [\"weapon_pistol\"] = true,\n    [\"weapon_smg1\"] = true,\n    [\"weapon_ar2\"] = true,\n}\n\nif allowed[weaponName] then\n    -- found\nend\n```\nReason: A keyed lookup is O(1) average, while `table.HasValue` scans the list linearly and gets slower as the list grows.","model_patch":"```lua\nlocal allowed = {\n    [\"weapon_pistol\"] = true,\n    [\"weapon_smg1\"] = true,\n    [\"weapon_ar2\"] = true,\n}\n\nif allowed[weaponName] then\n    -- found\nend\n```\nReason: A keyed lookup is O(1) average, while `table.HasValue` scans the list linearly and gets slower as the list grows."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-literal.v1","fixtureId":"gmod.perf.table-literal.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f95a8fc610d720ad","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12602,"startedAt":"2026-07-10T17:26:46.303Z","completedAt":"2026-07-10T17:26:58.906Z","answerBytes":223,"answerChars":223,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14545,"completionTokens":204,"totalTokens":14749,"reasoningTokens":124,"cachedTokens":13824},"finalResponse":"```lua\nlocal t = {\n    x = 1,\n    y = 2,\n    z = 3,\n}\n``` \nReason: The constructor is faster because it builds the table with its fields in one step, instead of creating an empty table and doing extra assignments afterward.","model_patch":"```lua\nlocal t = {\n    x = 1,\n    y = 2,\n    z = 3,\n}\n``` \nReason: The constructor is faster because it builds the table with its fields in one step, instead of creating an empty table and doing extra assignments afterward."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-random.v1","fixtureId":"gmod.perf.table-random.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f3e090701953d4a9","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14617,"startedAt":"2026-07-10T17:26:46.316Z","completedAt":"2026-07-10T17:27:00.936Z","answerBytes":214,"answerChars":214,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14541,"completionTokens":188,"totalTokens":14729,"reasoningTokens":117,"cachedTokens":0},"finalResponse":"```lua\nlocal idx = math.random(#seq)\nlocal value = seq[idx]\n``` \nReason: For a sequential array, direct indexing with `math.random(#seq)` avoids the extra work `table.Random` does to scan/handle generic table keys.","model_patch":"```lua\nlocal idx = math.random(#seq)\nlocal value = seq[idx]\n``` \nReason: For a sequential array, direct indexing with `math.random(#seq)` avoids the extra work `table.Random` does to scan/handle generic table keys."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.x-times-x.v1","fixtureId":"gmod.perf.x-times-x.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"79d48008f6b5174f","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13175,"startedAt":"2026-07-10T17:26:46.458Z","completedAt":"2026-07-10T17:26:59.635Z","answerBytes":111,"answerChars":111,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14538,"completionTokens":156,"totalTokens":14694,"reasoningTokens":104,"cachedTokens":13824},"finalResponse":"```lua\nlocal y = x * x\n```\nReason: `x * x` avoids the function call and overhead of `math.pow` in a tight loop.","model_patch":"```lua\nlocal y = x * x\n```\nReason: `x * x` avoids the function call and overhead of `math.pow` in a tight loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.player-iterator.v1","fixtureId":"gmod.player-iterator.v1","fixtureVersion":2,"rubricVersion":"4","promptHash":"fe3d7469535a0ca2","adapterId":"codex","model":"gpt-5.4-mini@medium","model_name_or_path":"gpt-5.4-mini@medium","attemptIndex":1,"status":"partial","detail":"Uses ipairs but still allocates via player.GetAll() each time.","durationMs":11027,"startedAt":"2026-07-10T17:26:47.877Z","completedAt":"2026-07-10T17:26:58.905Z","answerBytes":240,"answerChars":240,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14550,"completionTokens":119,"totalTokens":14669,"reasoningTokens":44,"cachedTokens":13824},"finalResponse":"```lua\nfor _, ply in ipairs(player.GetAll()) do\n    -- visit each connected player here\nend\n```\nReason: `player.GetAll()` returns the current players as an array-like table, so `ipairs` is the direct loop for visiting each connected player.","model_patch":"```lua\nfor _, ply in ipairs(player.GetAll()) do\n    -- visit each connected player here\nend\n```\nReason: `player.GetAll()` returns the current players as an array-like table, so `ipairs` is the direct loop for visiting each connected player."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.ents-iterator.v1","fixtureId":"gmod.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"3990c92253db85bb","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16615,"startedAt":"2026-07-10T17:26:47.882Z","completedAt":"2026-07-10T17:27:04.498Z","answerBytes":245,"answerChars":245,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14545,"completionTokens":445,"totalTokens":14990,"reasoningTokens":364,"cachedTokens":0},"finalResponse":"```lua\nfor _, ent in ipairs(ents.FindByClass(\"prop_physics\")) do\n    -- visit each prop_physics here\nend\n```\nReason: `ents.FindByClass` returns only entities of the requested class, so it avoids building a table of every entity in the map first.","model_patch":"```lua\nfor _, ent in ipairs(ents.FindByClass(\"prop_physics\")) do\n    -- visit each prop_physics here\nend\n```\nReason: `ents.FindByClass` returns only entities of the requested class, so it avoids building a table of every entity in the map first."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.hook-add.v1","fixtureId":"gmod.hook-add.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"12d2222fdb7d6b90","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Registers a named hook with hook.Add.","durationMs":12641,"startedAt":"2026-07-10T17:26:48.518Z","completedAt":"2026-07-10T17:27:01.160Z","answerBytes":176,"answerChars":176,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14549,"completionTokens":167,"totalTokens":14716,"reasoningTokens":96,"cachedTokens":0},"finalResponse":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\nend)\n```\nReason: `hook.Add` registers a function on Garry's Mod's `Think` hook, and `MyAddon.Think` is the hook identifier.","model_patch":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\nend)\n```\nReason: `hook.Add` registers a function on Garry's Mod's `Think` hook, and `MyAddon.Think` is the hook identifier."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.isvalid.v1","fixtureId":"gmod.isvalid.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"35527312e59dfc13","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Uses IsValid for entity/object validity.","durationMs":11576,"startedAt":"2026-07-10T17:26:50.548Z","completedAt":"2026-07-10T17:27:02.125Z","answerBytes":177,"answerChars":177,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14542,"completionTokens":174,"totalTokens":14716,"reasoningTokens":109,"cachedTokens":0},"finalResponse":"```lua\nif IsValid(ent) then\n    -- safe to call methods on ent here\nend\n```\nReason: `IsValid(ent)` is the standard Garry's Mod check for a live entity reference before using it.","model_patch":"```lua\nif IsValid(ent) then\n    -- safe to call methods on ent here\nend\n```\nReason: `IsValid(ent)` is the standard Garry's Mod check for a live entity reference before using it."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.net-receivers.v1","fixtureId":"gmod.net-receivers.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"24d54ee8366753a6","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12885,"startedAt":"2026-07-10T17:26:51.365Z","completedAt":"2026-07-10T17:27:04.252Z","answerBytes":193,"answerChars":193,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14535,"completionTokens":220,"totalTokens":14755,"reasoningTokens":153,"cachedTokens":0},"finalResponse":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle the message here\nend)\n```\nReason: `net.Receive` registers the callback that runs when the `MyAddon.Sync` net message arrives.","model_patch":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle the message here\nend)\n```\nReason: `net.Receive` registers the callback that runs when the `MyAddon.Sync` net message arrives."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.angle-zero.v1","fixtureId":"gmod.perf.angle-zero.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f6bc97bf98280d62","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":18039,"startedAt":"2026-07-10T17:26:53.422Z","completedAt":"2026-07-10T17:27:11.462Z","answerBytes":310,"answerChars":310,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14545,"completionTokens":614,"totalTokens":15159,"reasoningTokens":516,"cachedTokens":0},"finalResponse":"```lua\n-- Fast: reuse the built-in zero angle instead of allocating a new one each time.\nlocal ZERO_ANGLE = angle_zero\n\n-- Example hot-path use:\n-- someFunc(ZERO_ANGLE)\n``` \nReason: `angle_zero` is a shared zeroed `Angle` value, so reusing it avoids repeated `Angle()` construction and allocation in hot paths.","model_patch":"```lua\n-- Fast: reuse the built-in zero angle instead of allocating a new one each time.\nlocal ZERO_ANGLE = angle_zero\n\n-- Example hot-path use:\n-- someFunc(ZERO_ANGLE)\n``` \nReason: `angle_zero` is a shared zeroed `Angle` value, so reusing it avoids repeated `Angle()` construction and allocation in hot paths."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.config-var.v1","fixtureId":"gmod.perf.config-var.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"bcc4ff8eb162b699","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":15036,"startedAt":"2026-07-10T17:26:53.625Z","completedAt":"2026-07-10T17:27:08.663Z","answerBytes":213,"answerChars":213,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14550,"completionTokens":415,"totalTokens":14965,"reasoningTokens":341,"cachedTokens":13824},"finalResponse":"```lua\nlocal addon_color = Color(255, 128, 0)\nlocal c = addon_color\n```\nReason: A local is faster to read than a nested table lookup or global access in Lua, so it is the best choice for a frequently read setting.","model_patch":"```lua\nlocal addon_color = Color(255, 128, 0)\nlocal c = addon_color\n```\nReason: A local is faster to read than a nested table lookup or global access in Lua, so it is the best choice for a frequently read setting."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.darkrpvar.v1","fixtureId":"gmod.perf.darkrpvar.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"02a37daa699cded3","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":17008,"startedAt":"2026-07-10T17:26:55.681Z","completedAt":"2026-07-10T17:27:12.691Z","answerBytes":199,"answerChars":199,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14546,"completionTokens":538,"totalTokens":15084,"reasoningTokens":468,"cachedTokens":13824},"finalResponse":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n```\nReason: DarkRP exposes the job through its own `DarkRPVar` API, so this is the preferred, supported way instead of reading the raw networked string.","model_patch":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n```\nReason: DarkRP exposes the job through its own `DarkRPVar` API, so this is the preferred, supported way instead of reading the raw networked string."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.disttosqr.v1","fixtureId":"gmod.perf.disttosqr.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a5772470c6859cdc","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13234,"startedAt":"2026-07-10T17:26:56.549Z","completedAt":"2026-07-10T17:27:09.785Z","answerBytes":245,"answerChars":245,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14543,"completionTokens":222,"totalTokens":14765,"reasoningTokens":139,"cachedTokens":0},"finalResponse":"```lua\nif pos1:DistToSqr(pos2) <= threshold * threshold then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root cost of `DistTo`, which is the right check when you only need to know whether two vectors are within a threshold.","model_patch":"```lua\nif pos1:DistToSqr(pos2) <= threshold * threshold then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root cost of `DistTo`, which is the right check when you only need to know whether two vectors are within a threshold."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ents-iterator.v1","fixtureId":"gmod.perf.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"306d3f1d05f28246","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":19485,"startedAt":"2026-07-10T17:26:58.906Z","completedAt":"2026-07-10T17:27:18.393Z","answerBytes":220,"answerChars":220,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14541,"completionTokens":275,"totalTokens":14816,"reasoningTokens":208,"cachedTokens":13824},"finalResponse":"```lua\nfor ent in ents.Iterator() do\n    -- visit each entity here\nend\n```\nReason: `ents.Iterator()` walks the entity list without allocating a full table, so it is the preferred efficient loop for visiting every entity.","model_patch":"```lua\nfor ent in ents.Iterator() do\n    -- visit each entity here\nend\n```\nReason: `ents.Iterator()` walks the entity list without allocating a full table, so it is the preferred efficient loop for visiting every entity."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-ents-near.v1","fixtureId":"gmod.perf.find-ents-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"07c583fc3d9fe09f","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":16975,"startedAt":"2026-07-10T17:26:58.907Z","completedAt":"2026-07-10T17:27:15.888Z","answerBytes":547,"answerChars":543,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14560,"completionTokens":519,"totalTokens":15079,"reasoningTokens":353,"cachedTokens":0},"finalResponse":"```lua\nlocal function GetNearbyEntities(ply, radius)\n    local pos = ply:GetPos()\n    local out = ents.FindInSphere(pos, radius)\n\n    local filtered = {}\n    for i = 1, #out do\n        local ent = out[i]\n        if ent ~= ply and IsValid(ent) then\n            filtered[#filtered + 1] = ent\n        end\n    end\n\n    return filtered\nend\n```\nReason: `ents.FindInSphere` is a fast built-in broad-phase query for “nearby entities” and is commonly benchmarked as one of the better choices for radius checks, without using `FindInPVS` as the default.","model_patch":"```lua\nlocal function GetNearbyEntities(ply, radius)\n    local pos = ply:GetPos()\n    local out = ents.FindInSphere(pos, radius)\n\n    local filtered = {}\n    for i = 1, #out do\n        local ent = out[i]\n        if ent ~= ply and IsValid(ent) then\n            filtered[#filtered + 1] = ent\n        end\n    end\n\n    return filtered\nend\n```\nReason: `ents.FindInSphere` is a fast built-in broad-phase query for “nearby entities” and is commonly benchmarked as one of the better choices for radius checks, without using `FindInPVS` as the default."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-players-near.v1","fixtureId":"gmod.perf.find-players-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d139ba2e8ee38a2f","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":15537,"startedAt":"2026-07-10T17:26:59.636Z","completedAt":"2026-07-10T17:27:15.174Z","answerBytes":407,"answerChars":407,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14556,"completionTokens":430,"totalTokens":14986,"reasoningTokens":298,"cachedTokens":13824},"finalResponse":"```lua\nlocal function PlayersInSphere(pos, radius)\n    local radiusSqr = radius * radius\n    local found = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if ply:GetPos():DistToSqr(pos) <= radiusSqr then\n            found[#found + 1] = ply\n        end\n    end\n\n    return found\nend\n``` \nReason: `player.GetAll()` only walks players, not every entity, and `DistToSqr` avoids a square root per check.","model_patch":"```lua\nlocal function PlayersInSphere(pos, radius)\n    local radiusSqr = radius * radius\n    local found = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if ply:GetPos():DistToSqr(pos) <= radiusSqr then\n            found[#found + 1] = ply\n        end\n    end\n\n    return found\nend\n``` \nReason: `player.GetAll()` only walks players, not every entity, and `DistToSqr` avoids a square root per check."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.for-vs-while.v1","fixtureId":"gmod.perf.for-vs-while.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b3401a190a8aecf0","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13576,"startedAt":"2026-07-10T17:26:59.786Z","completedAt":"2026-07-10T17:27:13.363Z","answerBytes":242,"answerChars":242,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14547,"completionTokens":296,"totalTokens":14843,"reasoningTokens":215,"cachedTokens":13824},"finalResponse":"```lua\nlocal sum = 0\nfor i = 1, n do\n    sum = sum + i\nend\n```\nReason: Numeric `for` is generally faster in Lua for tight counted loops because the VM handles the counter and limit more efficiently than a manual `while` increment and compare.","model_patch":"```lua\nlocal sum = 0\nfor i = 1, n do\n    sum = sum + i\nend\n```\nReason: Numeric `for` is generally faster in Lua for tight counted loops because the VM handles the counter and limit more efficiently than a manual `while` increment and compare."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hook-once.v1","fixtureId":"gmod.perf.hook-once.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ed1d3e09249fc8bb","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16582,"startedAt":"2026-07-10T17:27:00.706Z","completedAt":"2026-07-10T17:27:17.290Z","answerBytes":293,"answerChars":293,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14555,"completionTokens":490,"totalTokens":15045,"reasoningTokens":399,"cachedTokens":0},"finalResponse":"```lua\nhook.Add(\"Think\", \"NotifyPlayersEachTick\", function()\n    local players = player.GetAll()\n    hook.Run(\"MyCustomPlayerTick\", players)\nend)\n``` \nReason: one `hook.Run` per tick is faster than one `hook.Run` per player because it avoids repeated hook dispatch and Lua/C boundary overhead.","model_patch":"```lua\nhook.Add(\"Think\", \"NotifyPlayersEachTick\", function()\n    local players = player.GetAll()\n    hook.Run(\"MyCustomPlayerTick\", players)\nend)\n``` \nReason: one `hook.Run` per tick is faster than one `hook.Run` per player because it avoids repeated hook dispatch and Lua/C boundary overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hudpaint-cache.v1","fixtureId":"gmod.perf.hudpaint-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3def450f3158ceff","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14580,"startedAt":"2026-07-10T17:27:00.936Z","completedAt":"2026-07-10T17:27:15.518Z","answerBytes":503,"answerChars":503,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14552,"completionTokens":285,"totalTokens":14837,"reasoningTokens":120,"cachedTokens":13824},"finalResponse":"```lua\nhook.Add(\"HUDPaint\", \"MyHealthHUD\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    local health = lp:Health()\n\n    draw.SimpleText(health, \"DermaDefault\", 100, 100, color_white)\n    draw.SimpleText(health, \"DermaDefault\", 100, 120, color_white)\n    draw.SimpleText(health, \"DermaDefault\", 100, 140, color_white)\nend)\n```\nReason: Cache `LocalPlayer()` and `:Health()` once per frame so the three draw calls reuse the same value instead of repeating the lookup.","model_patch":"```lua\nhook.Add(\"HUDPaint\", \"MyHealthHUD\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    local health = lp:Health()\n\n    draw.SimpleText(health, \"DermaDefault\", 100, 100, color_white)\n    draw.SimpleText(health, \"DermaDefault\", 100, 120, color_white)\n    draw.SimpleText(health, \"DermaDefault\", 100, 140, color_white)\nend)\n```\nReason: Cache `LocalPlayer()` and `:Health()` once per frame so the three draw calls reuse the same value instead of repeating the lookup."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-color.v1","fixtureId":"gmod.perf.local-color.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"16a7bed1b931d467","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":22799,"startedAt":"2026-07-10T17:27:01.161Z","completedAt":"2026-07-10T17:27:23.962Z","answerBytes":296,"answerChars":296,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14540,"completionTokens":217,"totalTokens":14757,"reasoningTokens":104,"cachedTokens":13824},"finalResponse":"```lua\nlocal WHITE = Color(255, 255, 255)\n\nhook.Add(\"HUDPaint\", \"MyPaintLoop\", function()\n    for i = 1, 100 do\n        surface.SetDrawColor(WHITE)\n        surface.DrawRect(i, 10, 1, 1)\n    end\nend)\n```\nReason: Reusing one prebuilt `Color` avoids allocating a new color object on every iteration.","model_patch":"```lua\nlocal WHITE = Color(255, 255, 255)\n\nhook.Add(\"HUDPaint\", \"MyPaintLoop\", function()\n    for i = 1, 100 do\n        surface.SetDrawColor(WHITE)\n        surface.DrawRect(i, 10, 1, 1)\n    end\nend)\n```\nReason: Reusing one prebuilt `Color` avoids allocating a new color object on every iteration."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-vs-global.v1","fixtureId":"gmod.perf.local-vs-global.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"c116d8c651190647","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12297,"startedAt":"2026-07-10T17:27:02.126Z","completedAt":"2026-07-10T17:27:14.425Z","answerBytes":188,"answerChars":188,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14540,"completionTokens":153,"totalTokens":14693,"reasoningTokens":76,"cachedTokens":13824},"finalResponse":"```lua\nlocal sin = math.sin\n\nfor i = 1, 100000 do\n    local y = sin(i)\n    -- use y\nend\n``` \nReason: Caching `math.sin` in a local avoids repeated global/table lookups inside the hot loop.","model_patch":"```lua\nlocal sin = math.sin\n\nfor i = 1, 100000 do\n    local y = sin(i)\n    -- use y\nend\n``` \nReason: Caching `math.sin` in a local avoids repeated global/table lookups inside the hot loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.localplayer-cache.v1","fixtureId":"gmod.perf.localplayer-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7398105af47b079e","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":28758,"startedAt":"2026-07-10T17:27:02.184Z","completedAt":"2026-07-10T17:27:30.945Z","answerBytes":465,"answerChars":465,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14547,"completionTokens":1391,"totalTokens":15938,"reasoningTokens":1253,"cachedTokens":13824},"finalResponse":"```lua\nlocal LocalPlayer = LocalPlayer\nlocal IsValid = IsValid\n\nlocal cachedLP\n\nlocal function GetLocalPlayerCached()\n    if not IsValid(cachedLP) then\n        cachedLP = LocalPlayer()\n    end\n\n    return cachedLP\nend\n\n-- hot path\nlocal lp = GetLocalPlayerCached()\nif IsValid(lp) then\n    -- reuse `lp` instead of calling LocalPlayer() repeatedly\nend\n``` \nReason: it turns repeated global/function lookups into one cached local reference that you reuse in hot code.","model_patch":"```lua\nlocal LocalPlayer = LocalPlayer\nlocal IsValid = IsValid\n\nlocal cachedLP\n\nlocal function GetLocalPlayerCached()\n    if not IsValid(cachedLP) then\n        cachedLP = LocalPlayer()\n    end\n\n    return cachedLP\nend\n\n-- hot path\nlocal lp = GetLocalPlayerCached()\nif IsValid(lp) then\n    -- reuse `lp` instead of calling LocalPlayer() repeatedly\nend\n``` \nReason: it turns repeated global/function lookups into one cached local reference that you reuse in hot code."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.looking-at.v1","fixtureId":"gmod.perf.looking-at.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"20b22f678a4b08d7","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":21003,"startedAt":"2026-07-10T17:27:04.252Z","completedAt":"2026-07-10T17:27:25.258Z","answerBytes":623,"answerChars":623,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14557,"completionTokens":671,"totalTokens":15228,"reasoningTokens":458,"cachedTokens":13824},"finalResponse":"```lua\nlocal function RoughlyLookingAtEachOther(plyA, plyB, cosLimit)\n    if not (IsValid(plyA) and IsValid(plyB)) then return false end\n\n    cosLimit = cosLimit or 0.7 -- about 45 degrees; raise for a tighter check\n\n    local aAim = plyA:GetAimVector() -- normalized\n    local bAim = plyB:GetAimVector() -- normalized\n\n    local aToB = (plyB:EyePos() - plyA:EyePos()):GetNormalized()\n    local bToA = -aToB\n\n    return aAim:Dot(aToB) >= cosLimit\n       and bAim:Dot(bToA) >= cosLimit\nend\n``` \nReason: `Dot` plus a cosine threshold is fast and avoids `math.acos` while still testing whether each player is facing the other.","model_patch":"```lua\nlocal function RoughlyLookingAtEachOther(plyA, plyB, cosLimit)\n    if not (IsValid(plyA) and IsValid(plyB)) then return false end\n\n    cosLimit = cosLimit or 0.7 -- about 45 degrees; raise for a tighter check\n\n    local aAim = plyA:GetAimVector() -- normalized\n    local bAim = plyB:GetAimVector() -- normalized\n\n    local aToB = (plyB:EyePos() - plyA:EyePos()):GetNormalized()\n    local bToA = -aToB\n\n    return aAim:Dot(aToB) >= cosLimit\n       and bAim:Dot(bToA) >= cosLimit\nend\n``` \nReason: `Dot` plus a cosine threshold is fast and avoids `math.acos` while still testing whether each player is facing the other."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.meta-vs-arg.v1","fixtureId":"gmod.perf.meta-vs-arg.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de332f7356830dfa","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16614,"startedAt":"2026-07-10T17:27:04.499Z","completedAt":"2026-07-10T17:27:21.115Z","answerBytes":193,"answerChars":193,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14551,"completionTokens":527,"totalTokens":15078,"reasoningTokens":461,"cachedTokens":13824},"finalResponse":"```lua\nSomeHelper(ply)\n```\nReason: for a helper you control, a plain function call avoids method lookup and the implicit `self` passing, so it is generally a bit faster than `ply:SomeHelper()`.","model_patch":"```lua\nSomeHelper(ply)\n```\nReason: for a helper you control, a plain function call avoids method lookup and the implicit `self` passing, so it is generally a bit faster than `ply:SomeHelper()`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.msg-vs-print.v1","fixtureId":"gmod.perf.msg-vs-print.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"6cbb4e4b2f19dd24","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":18045,"startedAt":"2026-07-10T17:27:05.301Z","completedAt":"2026-07-10T17:27:23.347Z","answerBytes":183,"answerChars":183,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14544,"completionTokens":387,"totalTokens":14931,"reasoningTokens":324,"cachedTokens":0},"finalResponse":"```lua\nMsgN(\"hot path debug\")\n```\nReason: `MsgN` writes directly to the console with less overhead than `print` when you do not need Lua-style formatting or multiple-argument joining.","model_patch":"```lua\nMsgN(\"hot path debug\")\n```\nReason: `MsgN` writes directly to the console with less overhead than `print` when you do not need Lua-style formatting or multiple-argument joining."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.pairs-ipairs-for.v1","fixtureId":"gmod.perf.pairs-ipairs-for.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de5e4875fcf3e600","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11458,"startedAt":"2026-07-10T17:27:05.433Z","completedAt":"2026-07-10T17:27:16.892Z","answerBytes":216,"answerChars":216,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14550,"completionTokens":155,"totalTokens":14705,"reasoningTokens":69,"cachedTokens":13824},"finalResponse":"```lua\nfor i = 1, #t do\n    local v = t[i]\n    -- use v\nend\n```\nReason: `for i = 1, #t do` is typically fastest for a dense sequential array-like table because it avoids the iterator overhead of `pairs` and `ipairs`.","model_patch":"```lua\nfor i = 1, #t do\n    local v = t[i]\n    -- use v\nend\n```\nReason: `for i = 1, #t do` is typically fastest for a dense sequential array-like table because it avoids the iterator overhead of `pairs` and `ipairs`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.plain-lua-vs-fn.v1","fixtureId":"gmod.perf.plain-lua-vs-fn.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ead0a98b3ff6a388","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":17296,"startedAt":"2026-07-10T17:27:08.663Z","completedAt":"2026-07-10T17:27:25.961Z","answerBytes":680,"answerChars":680,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14562,"completionTokens":519,"totalTokens":15081,"reasoningTokens":310,"cachedTokens":0},"finalResponse":"```lua\n-- Faster than chaining DarkRP fn filter/map combinators: one pass, no intermediates.\nlocal function filterMap(list, keep, map)\n    local out = {}\n    local n = 0\n\n    for i = 1, #list do\n        local v = list[i]\n        if keep(v) then\n            n = n + 1\n            out[n] = map(v)\n        end\n    end\n\n    return out\nend\n\n-- Example: keep active players and map to nicknames.\nlocal names = filterMap(player.GetAll(),\n    function(p) return IsValid(p) and p:Alive() end,\n    function(p) return p:Nick() end\n)\n``` \nReason: One tight loop with no combinator chaining, no extra closures per stage, and no intermediate lists, so it does less allocation and dispatch work.","model_patch":"```lua\n-- Faster than chaining DarkRP fn filter/map combinators: one pass, no intermediates.\nlocal function filterMap(list, keep, map)\n    local out = {}\n    local n = 0\n\n    for i = 1, #list do\n        local v = list[i]\n        if keep(v) then\n            n = n + 1\n            out[n] = map(v)\n        end\n    end\n\n    return out\nend\n\n-- Example: keep active players and map to nicknames.\nlocal names = filterMap(player.GetAll(),\n    function(p) return IsValid(p) and p:Alive() end,\n    function(p) return p:Nick() end\n)\n``` \nReason: One tight loop with no combinator chaining, no extra closures per stage, and no intermediate lists, so it does less allocation and dispatch work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.player-cache-hooks.v1","fixtureId":"gmod.perf.player-cache-hooks.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a834817afe9e6c25","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":17463,"startedAt":"2026-07-10T17:27:09.786Z","completedAt":"2026-07-10T17:27:27.250Z","answerBytes":632,"answerChars":632,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14559,"completionTokens":599,"totalTokens":15158,"reasoningTokens":425,"cachedTokens":13824},"finalResponse":"```lua\nlocal cachedPlayers = player.GetAll()\n\nlocal function RefreshPlayers()\n    cachedPlayers = player.GetAll()\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"RefreshCachedPlayersOnJoin\", RefreshPlayers)\nhook.Add(\"PlayerDisconnected\", \"RefreshCachedPlayersOnLeave\", RefreshPlayers)\n\nhook.Add(\"Think\", \"UseCachedPlayersInsteadOfPlayerGetAll\", function()\n    for _, ply in ipairs(cachedPlayers) do\n        if IsValid(ply) then\n            -- work with ply\n        end\n    end\nend)\n``` \nReason: `player.GetAll()` allocates and repopulates a table every tick; caching once and refreshing only on join/leave removes that repeated per-frame work.","model_patch":"```lua\nlocal cachedPlayers = player.GetAll()\n\nlocal function RefreshPlayers()\n    cachedPlayers = player.GetAll()\nend\n\nhook.Add(\"PlayerInitialSpawn\", \"RefreshCachedPlayersOnJoin\", RefreshPlayers)\nhook.Add(\"PlayerDisconnected\", \"RefreshCachedPlayersOnLeave\", RefreshPlayers)\n\nhook.Add(\"Think\", \"UseCachedPlayersInsteadOfPlayerGetAll\", function()\n    for _, ply in ipairs(cachedPlayers) do\n        if IsValid(ply) then\n            -- work with ply\n        end\n    end\nend)\n``` \nReason: `player.GetAll()` allocates and repopulates a table every tick; caching once and refreshing only on join/leave removes that repeated per-frame work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ply-table-index.v1","fixtureId":"gmod.perf.ply-table-index.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f18cc80df8999147","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":17249,"startedAt":"2026-07-10T17:27:10.425Z","completedAt":"2026-07-10T17:27:27.675Z","answerBytes":412,"answerChars":412,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14544,"completionTokens":549,"totalTokens":15093,"reasoningTokens":406,"cachedTokens":13824},"finalResponse":"```lua\nlocal tempByPly = setmetatable({}, { __mode = \"k\" }) -- weak keys, auto-clears when player entity is gone\n\nlocal function SetTemp(ply, value)\n    tempByPly[ply] = value\nend\n\nlocal function GetTemp(ply)\n    return tempByPly[ply]\nend\n\n-- hot path\nlocal v = tempByPly[ply]\n``` \nReason: a weak-key side table avoids per-entity field lookup on `ply` and keeps reads as a direct table index by player reference.","model_patch":"```lua\nlocal tempByPly = setmetatable({}, { __mode = \"k\" }) -- weak keys, auto-clears when player entity is gone\n\nlocal function SetTemp(ply, value)\n    tempByPly[ply] = value\nend\n\nlocal function GetTemp(ply)\n    return tempByPly[ply]\nend\n\n-- hot path\nlocal v = tempByPly[ply]\n``` \nReason: a weak-key side table avoids per-entity field lookup on `ply` and keeps reads as a direct table index by player reference."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.seq-tables.v1","fixtureId":"gmod.perf.seq-tables.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4778b0220c3f91a3","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14693,"startedAt":"2026-07-10T17:27:11.463Z","completedAt":"2026-07-10T17:27:26.157Z","answerBytes":352,"answerChars":352,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14547,"completionTokens":342,"totalTokens":14889,"reasoningTokens":234,"cachedTokens":13824},"finalResponse":"```lua\n-- Faster for iteration: sequential numeric indices\nlocal values = { \"alpha\", \"beta\", \"gamma\", \"delta\" }\n\nfor i = 1, #values do\n  local v = values[i]\n  -- use v\nend\n``` \nReason: Sequential number-indexed arrays are faster to iterate in Lua because they use direct array-style access, while string-keyed maps require hash lookup for each element.","model_patch":"```lua\n-- Faster for iteration: sequential numeric indices\nlocal values = { \"alpha\", \"beta\", \"gamma\", \"delta\" }\n\nfor i = 1, #values do\n  local v = values[i]\n  -- use v\nend\n``` \nReason: Sequential number-indexed arrays are faster to iterate in Lua because they use direct array-style access, while string-keyed maps require hash lookup for each element."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.setdrawcolor-split.v1","fixtureId":"gmod.perf.setdrawcolor-split.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d110fde8a37bbe59","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12966,"startedAt":"2026-07-10T17:27:12.692Z","completedAt":"2026-07-10T17:27:25.660Z","answerBytes":179,"answerChars":179,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14552,"completionTokens":235,"totalTokens":14787,"reasoningTokens":171,"cachedTokens":13824},"finalResponse":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Separate numeric RGBA arguments avoid the extra Color-object handling and are the faster call style in a hot draw path.","model_patch":"```lua\nsurface.SetDrawColor(255, 255, 255, 255)\n```\nReason: Separate numeric RGBA arguments avoid the extra Color-object handling and are the faster call style in a hot draw path."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.sqlite-vs-mysql.v1","fixtureId":"gmod.perf.sqlite-vs-mysql.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4a3f5d2a20d71ac9","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16317,"startedAt":"2026-07-10T17:27:13.096Z","completedAt":"2026-07-10T17:27:29.414Z","answerBytes":316,"answerChars":316,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14568,"completionTokens":458,"totalTokens":15026,"reasoningTokens":366,"cachedTokens":13824},"finalResponse":"```lua\nlocal row = sql.QueryRow(\"SELECT value FROM playerdata WHERE steamid = \" .. sql.SQLStr(steamid))\n```\nReason: For a single Garry's Mod server with no cross-server sync, local SQLite is typically lower latency because it stays in-process/on-disk, while MySQL adds network round trips and remote server overhead.","model_patch":"```lua\nlocal row = sql.QueryRow(\"SELECT value FROM playerdata WHERE steamid = \" .. sql.SQLStr(steamid))\n```\nReason: For a single Garry's Mod server with no cross-server sync, local SQLite is typically lower latency because it stays in-process/on-disk, while MySQL adds network round trips and remote server overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.steamid-cache.v1","fixtureId":"gmod.perf.steamid-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"e8a94aa454154982","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":17162,"startedAt":"2026-07-10T17:27:13.363Z","completedAt":"2026-07-10T17:27:30.526Z","answerBytes":565,"answerChars":565,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14541,"completionTokens":521,"totalTokens":15062,"reasoningTokens":344,"cachedTokens":13824},"finalResponse":"```lua\nlocal steamid_cache = setmetatable({}, { __mode = \"k\" }) -- weak keys, no leak after players go away\n\nlocal function GetSteamIDFast(ply)\n    local sid = steamid_cache[ply]\n    if sid == nil then\n        sid = ply:SteamID()\n        steamid_cache[ply] = sid\n    end\n    return sid\nend\n\n-- hot path\nfor _, ply in ipairs(player.GetAll()) do\n    local sid = GetSteamIDFast(ply)\n    -- use sid repeatedly here instead of ply:SteamID()\nend\n``` \nReason: `SteamID()` is a repeated cross-boundary lookup; caching it once per player removes duplicate work in hot loops.","model_patch":"```lua\nlocal steamid_cache = setmetatable({}, { __mode = \"k\" }) -- weak keys, no leak after players go away\n\nlocal function GetSteamIDFast(ply)\n    local sid = steamid_cache[ply]\n    if sid == nil then\n        sid = ply:SteamID()\n        steamid_cache[ply] = sid\n    end\n    return sid\nend\n\n-- hot path\nfor _, ply in ipairs(player.GetAll()) do\n    local sid = GetSteamIDFast(ply)\n    -- use sid repeatedly here instead of ply:SteamID()\nend\n``` \nReason: `SteamID()` is a repeated cross-boundary lookup; caching it once per player removes duplicate work in hot loops."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.string-table-concat.v1","fixtureId":"gmod.perf.string-table-concat.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b0cf9e04ae7c5dd9","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":16354,"startedAt":"2026-07-10T17:27:14.426Z","completedAt":"2026-07-10T17:27:30.782Z","answerBytes":418,"answerChars":418,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14540,"completionTokens":387,"totalTokens":14927,"reasoningTokens":244,"cachedTokens":13824},"finalResponse":"```lua\n-- Slow: repeated string rebuilding in a loop\n-- local out = \"\"\n-- for i = 1, #pieces do\n--     out = out .. pieces[i]\n-- end\n\n-- Fast: collect pieces, join once\nlocal parts = {}\nfor i = 1, #pieces do\n    parts[#parts + 1] = pieces[i]\nend\n\nlocal out = table.concat(parts)\n``` \nReason: `table.concat` joins all pieces in one pass, so it avoids the repeated reallocations and copying caused by `..` inside a loop.","model_patch":"```lua\n-- Slow: repeated string rebuilding in a loop\n-- local out = \"\"\n-- for i = 1, #pieces do\n--     out = out .. pieces[i]\n-- end\n\n-- Fast: collect pieces, join once\nlocal parts = {}\nfor i = 1, #pieces do\n    parts[#parts + 1] = pieces[i]\nend\n\nlocal out = table.concat(parts)\n``` \nReason: `table.concat` joins all pieces in one pass, so it avoids the repeated reallocations and copying caused by `..` inside a loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-drawrect.v1","fixtureId":"gmod.perf.surface-drawrect.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"696e8de769d9ad0e","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14471,"startedAt":"2026-07-10T17:27:15.175Z","completedAt":"2026-07-10T17:27:29.647Z","answerBytes":232,"answerChars":232,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14546,"completionTokens":338,"totalTokens":14884,"reasoningTokens":251,"cachedTokens":13824},"finalResponse":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` skips the rounded-rect path and is the direct primitive for solid rectangles, so it is a bit cheaper than `draw.RoundedBox(0, ...)`.","model_patch":"```lua\nsurface.SetDrawColor(r, g, b, a)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` skips the rounded-rect path and is the direct primitive for solid rectangles, so it is a bit cheaper than `draw.RoundedBox(0, ...)`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-text.v1","fixtureId":"gmod.perf.surface-text.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"95d9fe4918ee4197","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16621,"startedAt":"2026-07-10T17:27:15.519Z","completedAt":"2026-07-10T17:27:32.142Z","answerBytes":416,"answerChars":416,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14545,"completionTokens":517,"totalTokens":15062,"reasoningTokens":376,"cachedTokens":13824},"finalResponse":"```lua\nlocal fontName = \"Trebuchet18\"\nlocal text = \"Hello\"\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    surface.SetFont(fontName)\n    surface.SetTextColor(255, 255, 255, 255)\n    surface.SetTextPos(50, 50)\n    surface.DrawText(text)\nend)\n``` \nReason: `surface.DrawText` with cached font/color/position is the lightest of these options; `draw.DrawText` and especially `SimpleTextOutlined` do extra work.","model_patch":"```lua\nlocal fontName = \"Trebuchet18\"\nlocal text = \"Hello\"\n\nhook.Add(\"HUDPaint\", \"FastSingleLineText\", function()\n    surface.SetFont(fontName)\n    surface.SetTextColor(255, 255, 255, 255)\n    surface.SetTextPos(50, 50)\n    surface.DrawText(text)\nend)\n``` \nReason: `surface.DrawText` with cached font/color/position is the lightest of these options; `draw.DrawText` and especially `SimpleTextOutlined` do extra work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-count-hash.v1","fixtureId":"gmod.perf.table-count-hash.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3e9bbfc8452e05e3","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12387,"startedAt":"2026-07-10T17:27:15.889Z","completedAt":"2026-07-10T17:27:28.277Z","answerBytes":182,"answerChars":182,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14539,"completionTokens":189,"totalTokens":14728,"reasoningTokens":126,"cachedTokens":13824},"finalResponse":"```lua\nlocal len = #myTable\n```\nReason: For a sequential array-like table, the preferred Lua length operator is `#`; `table.Count` is for counting all keys in a non-sequential table.","model_patch":"```lua\nlocal len = #myTable\n```\nReason: For a sequential array-like table, the preferred Lua length operator is `#`; `table.Count` is for counting all keys in a non-sequential table."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-empty.v1","fixtureId":"gmod.perf.table-empty.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3a6344977f5bd475","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":14776,"startedAt":"2026-07-10T17:27:16.893Z","completedAt":"2026-07-10T17:27:31.670Z","answerBytes":249,"answerChars":249,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14546,"completionTokens":416,"totalTokens":14962,"reasoningTokens":335,"cachedTokens":13824},"finalResponse":"```lua\nt = {}\n```\nReason: `t = {}` is generally faster because it just makes `t` point at a new empty table, while `table.Empty(t)` has to clear the existing table in place; use `table.Empty(t)` only when other references must see the table emptied.","model_patch":"```lua\nt = {}\n```\nReason: `t = {}` is generally faster because it just makes `t` point at a new empty table, while `table.Empty(t)` has to clear the existing table in place; use `table.Empty(t)` only when other references must see the table emptied."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-hasvalue.v1","fixtureId":"gmod.perf.table-hasvalue.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7d064428a873fdfc","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":9127,"startedAt":"2026-07-10T17:27:17.291Z","completedAt":"2026-07-10T17:27:26.420Z","answerBytes":285,"answerChars":285,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14548,"completionTokens":237,"totalTokens":14785,"reasoningTokens":130,"cachedTokens":13824},"finalResponse":"```lua\nlocal allowed = {\n    [\"apple\"] = true,\n    [\"banana\"] = true,\n    [\"orange\"] = true\n}\n\nif allowed[value] then\n    -- value exists in the set\nend\n```\nReason: `allowed[value]` is an O(1) hash lookup, while `table.HasValue` scans a list linearly and gets slower as the list grows.","model_patch":"```lua\nlocal allowed = {\n    [\"apple\"] = true,\n    [\"banana\"] = true,\n    [\"orange\"] = true\n}\n\nif allowed[value] then\n    -- value exists in the set\nend\n```\nReason: `allowed[value]` is an O(1) hash lookup, while `table.HasValue` scans a list linearly and gets slower as the list grows."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-literal.v1","fixtureId":"gmod.perf.table-literal.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f95a8fc610d720ad","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":9215,"startedAt":"2026-07-10T17:27:18.394Z","completedAt":"2026-07-10T17:27:27.610Z","answerBytes":237,"answerChars":237,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14545,"completionTokens":243,"totalTokens":14788,"reasoningTokens":157,"cachedTokens":13824},"finalResponse":"```lua\nlocal t = {\n    x = 1,\n    y = 2,\n    z = 3,\n}\n``` \nReason: The table constructor is faster here because Lua can create and populate the table in one step, while `t = {}` followed by assignments does extra separate writes/lookups.","model_patch":"```lua\nlocal t = {\n    x = 1,\n    y = 2,\n    z = 3,\n}\n``` \nReason: The table constructor is faster here because Lua can create and populate the table in one step, while `t = {}` followed by assignments does extra separate writes/lookups."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-random.v1","fixtureId":"gmod.perf.table-random.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f3e090701953d4a9","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":5540,"startedAt":"2026-07-10T17:27:21.115Z","completedAt":"2026-07-10T17:27:26.657Z","answerBytes":273,"answerChars":273,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":69,"totalTokens":135,"source":"estimated"},"finalResponse":"```lua\nlocal function FastRandom(seq)\n    local n = #seq\n    if n == 0 then return nil end\n    return seq[math.random(n)]\nend\n```\nReason: Sequential tables are array-like, so direct indexing with `math.random(#seq)` avoids `table.Random`'s generic table traversal overhead.","model_patch":"```lua\nlocal function FastRandom(seq)\n    local n = #seq\n    if n == 0 then return nil end\n    return seq[math.random(n)]\nend\n```\nReason: Sequential tables are array-like, so direct indexing with `math.random(#seq)` avoids `table.Random`'s generic table traversal overhead."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.x-times-x.v1","fixtureId":"gmod.perf.x-times-x.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"79d48008f6b5174f","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5204,"startedAt":"2026-07-10T17:27:23.348Z","completedAt":"2026-07-10T17:27:28.553Z","answerBytes":159,"answerChars":159,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":58,"completionTokens":40,"totalTokens":98,"source":"estimated"},"finalResponse":"```lua\nlocal y = x * x\n```\nReason: `x * x` is the fastest clear form in Lua for squaring because it avoids function-call overhead and exponentiation machinery.","model_patch":"```lua\nlocal y = x * x\n```\nReason: `x * x` is the fastest clear form in Lua for squaring because it avoids function-call overhead and exponentiation machinery."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.player-iterator.v1","fixtureId":"gmod.player-iterator.v1","fixtureVersion":2,"rubricVersion":"4","promptHash":"fe3d7469535a0ca2","adapterId":"codex","model":"gpt-5.4-mini@high","model_name_or_path":"gpt-5.4-mini@high","attemptIndex":1,"status":"partial","detail":"Uses ipairs but still allocates via player.GetAll() each time.","durationMs":5188,"startedAt":"2026-07-10T17:27:23.963Z","completedAt":"2026-07-10T17:27:29.153Z","answerBytes":165,"answerChars":165,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":80,"completionTokens":42,"totalTokens":122,"source":"estimated"},"finalResponse":"```lua\nfor _, ply in ipairs(player.GetAll()) do\n    -- loop body\nend\n```\nReason: `player.GetAll()` returns the connected player list, and `ipairs` walks it in order.","model_patch":"```lua\nfor _, ply in ipairs(player.GetAll()) do\n    -- loop body\nend\n```\nReason: `player.GetAll()` returns the connected player list, and `ipairs` walks it in order."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.ents-iterator.v1","fixtureId":"gmod.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"3990c92253db85bb","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":127769,"startedAt":"2026-07-10T17:27:25.258Z","completedAt":"2026-07-10T17:29:33.029Z","answerBytes":216,"answerChars":216,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":72,"completionTokens":54,"totalTokens":126,"source":"estimated"},"finalResponse":"```lua\nfor _, ent in pairs(ents.FindByClass(\"prop_physics\")) do\n    -- visit ent here\nend\n```\nReason: `ents.FindByClass` returns only `prop_physics` entities, so you avoid building a full map-wide entity table first.","model_patch":"```lua\nfor _, ent in pairs(ents.FindByClass(\"prop_physics\")) do\n    -- visit ent here\nend\n```\nReason: `ents.FindByClass` returns only `prop_physics` entities, so you avoid building a full map-wide entity table first."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.hook-add.v1","fixtureId":"gmod.hook-add.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"12d2222fdb7d6b90","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Registers a named hook with hook.Add.","durationMs":9218,"startedAt":"2026-07-10T17:27:25.661Z","completedAt":"2026-07-10T17:27:34.881Z","answerBytes":176,"answerChars":176,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":78,"completionTokens":44,"totalTokens":122,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\nend)\n```\nReason: Registers the callback under the `Think` hook with the identifier `MyAddon.Think`, so it runs every frame.","model_patch":"```lua\nhook.Add(\"Think\", \"MyAddon.Think\", function()\nend)\n```\nReason: Registers the callback under the `Think` hook with the identifier `MyAddon.Think`, so it runs every frame."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.isvalid.v1","fixtureId":"gmod.isvalid.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"35527312e59dfc13","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Uses IsValid for entity/object validity.","durationMs":8393,"startedAt":"2026-07-10T17:27:25.963Z","completedAt":"2026-07-10T17:27:34.360Z","answerBytes":184,"answerChars":184,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":74,"completionTokens":46,"totalTokens":120,"source":"estimated"},"finalResponse":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: `IsValid(ent)` is the Garry's Mod guard for nil, removed, or otherwise invalid entities before calling methods on them.","model_patch":"```lua\nif IsValid(ent) then\n    ent:SomeMethod()\nend\n```\nReason: `IsValid(ent)` is the Garry's Mod guard for nil, removed, or otherwise invalid entities before calling methods on them."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.net-receivers.v1","fixtureId":"gmod.net-receivers.v1","fixtureVersion":1,"rubricVersion":"2","promptHash":"24d54ee8366753a6","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11801,"startedAt":"2026-07-10T17:27:26.158Z","completedAt":"2026-07-10T17:27:37.960Z","answerBytes":211,"answerChars":211,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":64,"completionTokens":53,"totalTokens":117,"source":"estimated"},"finalResponse":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle MyAddon.Sync here\nend)\n```\nReason: `net.Receive` registers the callback that runs when the incoming network message `MyAddon.Sync` is received.","model_patch":"```lua\nnet.Receive(\"MyAddon.Sync\", function(len, ply)\n    -- handle MyAddon.Sync here\nend)\n```\nReason: `net.Receive` registers the callback that runs when the incoming network message `MyAddon.Sync` is received."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.angle-zero.v1","fixtureId":"gmod.perf.angle-zero.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f6bc97bf98280d62","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":93025,"startedAt":"2026-07-10T17:27:26.421Z","completedAt":"2026-07-10T17:28:59.448Z","answerBytes":265,"answerChars":265,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":67,"totalTokens":138,"source":"estimated"},"finalResponse":"```lua\nlocal ANGLE_ZERO = angle_zero -- read-only cached zero angle\n\n-- slow:\n-- local ang = Angle()\n\n-- fast:\nlocal ang = ANGLE_ZERO\n```\nReason: `angle_zero` is preallocated, so reusing it avoids constructing a new `Angle` userdata and the GC churn from `Angle()`.","model_patch":"```lua\nlocal ANGLE_ZERO = angle_zero -- read-only cached zero angle\n\n-- slow:\n-- local ang = Angle()\n\n-- fast:\nlocal ang = ANGLE_ZERO\n```\nReason: `angle_zero` is preallocated, so reusing it avoids constructing a new `Angle` userdata and the GC churn from `Angle()`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.config-var.v1","fixtureId":"gmod.perf.config-var.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"bcc4ff8eb162b699","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":25042,"startedAt":"2026-07-10T17:27:26.658Z","completedAt":"2026-07-10T17:27:51.702Z","answerBytes":194,"answerChars":194,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":82,"completionTokens":49,"totalTokens":131,"source":"estimated"},"finalResponse":"```lua\nlocal addon_color = Color(255, 255, 255)\nlocal color = addon_color\n```\nReason: a local/upvalue read is faster than repeated `myaddon.config.color` table lookups, and faster than a global.","model_patch":"```lua\nlocal addon_color = Color(255, 255, 255)\nlocal color = addon_color\n```\nReason: a local/upvalue read is faster than repeated `myaddon.config.color` table lookups, and faster than a global."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.darkrpvar.v1","fixtureId":"gmod.perf.darkrpvar.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"02a37daa699cded3","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":46748,"startedAt":"2026-07-10T17:27:27.250Z","completedAt":"2026-07-10T17:28:14.000Z","answerBytes":206,"answerChars":206,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":52,"totalTokens":118,"source":"estimated"},"finalResponse":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n```\nReason: `getDarkRPVar(\"job\")` is DarkRP's public accessor for the synced job name, so it is the supported API instead of reading the raw NWString directly.","model_patch":"```lua\nlocal jobName = ply:getDarkRPVar(\"job\")\n```\nReason: `getDarkRPVar(\"job\")` is DarkRP's public accessor for the synced job name, so it is the supported API instead of reading the raw NWString directly."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.disttosqr.v1","fixtureId":"gmod.perf.disttosqr.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a5772470c6859cdc","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6162,"startedAt":"2026-07-10T17:27:27.611Z","completedAt":"2026-07-10T17:27:33.774Z","answerBytes":202,"answerChars":202,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":51,"totalTokens":122,"source":"estimated"},"finalResponse":"```lua\nif v1:DistToSqr(v2) < threshold * threshold then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root, so it is faster and the right choice when you only need a threshold check.","model_patch":"```lua\nif v1:DistToSqr(v2) < threshold * threshold then\n    -- within range\nend\n```\nReason: `DistToSqr` avoids the square root, so it is faster and the right choice when you only need a threshold check."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ents-iterator.v1","fixtureId":"gmod.perf.ents-iterator.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"306d3f1d05f28246","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":75779,"startedAt":"2026-07-10T17:27:27.676Z","completedAt":"2026-07-10T17:28:43.456Z","answerBytes":225,"answerChars":225,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":57,"totalTokens":123,"source":"estimated"},"finalResponse":"```lua\nfor _, ent in ents.Iterator() do\n    -- visit ent\nend\n```\nReason: `ents.Iterator()` walks entities without materializing `ents.GetAll()`'s table, so it is the better choice when you only need to visit each entity once.","model_patch":"```lua\nfor _, ent in ents.Iterator() do\n    -- visit ent\nend\n```\nReason: `ents.Iterator()` walks entities without materializing `ents.GetAll()`'s table, so it is the better choice when you only need to visit each entity once."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-ents-near.v1","fixtureId":"gmod.perf.find-ents-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"07c583fc3d9fe09f","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":13625,"startedAt":"2026-07-10T17:27:28.278Z","completedAt":"2026-07-10T17:27:41.905Z","answerBytes":367,"answerChars":363,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":83,"completionTokens":91,"totalTokens":174,"source":"estimated"},"finalResponse":"```lua\nlocal pos = ply:GetPos()\nlocal r = 512\nlocal mins = pos - Vector(r, r, r)\nlocal maxs = pos + Vector(r, r, r)\n\nlocal nearby = ents.FindInBox(mins, maxs)\n```\nReason: `FindInBox` is one of the fastest built-in broad-phase spatial queries in common GMod benchmarks, and it fits a cheap “near this player” check without the visibility semantics of `FindInPVS`. ","model_patch":"```lua\nlocal pos = ply:GetPos()\nlocal r = 512\nlocal mins = pos - Vector(r, r, r)\nlocal maxs = pos + Vector(r, r, r)\n\nlocal nearby = ents.FindInBox(mins, maxs)\n```\nReason: `FindInBox` is one of the fastest built-in broad-phase spatial queries in common GMod benchmarks, and it fits a cheap “near this player” check without the visibility semantics of `FindInPVS`. "}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.find-players-near.v1","fixtureId":"gmod.perf.find-players-near.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d139ba2e8ee38a2f","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11731,"startedAt":"2026-07-10T17:27:28.554Z","completedAt":"2026-07-10T17:27:40.286Z","answerBytes":444,"answerChars":444,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":111,"totalTokens":190,"source":"estimated"},"finalResponse":"```lua\nlocal function PlayersInRadius(pos, radius)\n    local radiusSqr = radius * radius\n    local out = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if pos:DistToSqr(ply:GetPos()) <= radiusSqr then\n            out[#out + 1] = ply\n        end\n    end\n\n    return out\nend\n``` \nReason: `player.GetAll()` iterates only players, so it avoids scanning every entity in `ents.FindInSphere`, and `DistToSqr` skips the expensive square root.","model_patch":"```lua\nlocal function PlayersInRadius(pos, radius)\n    local radiusSqr = radius * radius\n    local out = {}\n\n    for _, ply in ipairs(player.GetAll()) do\n        if pos:DistToSqr(ply:GetPos()) <= radiusSqr then\n            out[#out + 1] = ply\n        end\n    end\n\n    return out\nend\n``` \nReason: `player.GetAll()` iterates only players, so it avoids scanning every entity in `ents.FindInSphere`, and `DistToSqr` skips the expensive square root."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.for-vs-while.v1","fixtureId":"gmod.perf.for-vs-while.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b3401a190a8aecf0","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":7313,"startedAt":"2026-07-10T17:27:29.153Z","completedAt":"2026-07-10T17:27:36.468Z","answerBytes":147,"answerChars":147,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":65,"completionTokens":37,"totalTokens":102,"source":"estimated"},"finalResponse":"```lua\nfor i = 1, n do\n    -- work\nend\n```\nReason: a numeric `for` loop is generally faster than `while` for a tight 1..n counter loop in GMod Lua.","model_patch":"```lua\nfor i = 1, n do\n    -- work\nend\n```\nReason: a numeric `for` loop is generally faster than `while` for a tight 1..n counter loop in GMod Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hook-once.v1","fixtureId":"gmod.perf.hook-once.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ed1d3e09249fc8bb","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11059,"startedAt":"2026-07-10T17:27:29.415Z","completedAt":"2026-07-10T17:27:40.476Z","answerBytes":350,"answerChars":350,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":84,"completionTokens":88,"totalTokens":172,"source":"estimated"},"finalResponse":"```lua\n-- Faster: one hook dispatch per tick, pass the full player list.\nhook.Run(\"MyCustomTick\", player.GetAll())\n\n-- Slower: dispatches once per player.\nfor _, ply in ipairs(player.GetAll()) do\n    hook.Run(\"MyCustomTickPlayer\", ply)\nend\n``` \nReason: `hook.Run` has fixed dispatch overhead, so one call per tick is cheaper than one call per player.","model_patch":"```lua\n-- Faster: one hook dispatch per tick, pass the full player list.\nhook.Run(\"MyCustomTick\", player.GetAll())\n\n-- Slower: dispatches once per player.\nfor _, ply in ipairs(player.GetAll()) do\n    hook.Run(\"MyCustomTickPlayer\", ply)\nend\n``` \nReason: `hook.Run` has fixed dispatch overhead, so one call per tick is cheaper than one call per player."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.hudpaint-cache.v1","fixtureId":"gmod.perf.hudpaint-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3def450f3158ceff","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12411,"startedAt":"2026-07-10T17:27:29.570Z","completedAt":"2026-07-10T17:27:41.983Z","answerBytes":446,"answerChars":446,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":112,"totalTokens":188,"source":"estimated"},"finalResponse":"```lua\nhook.Add(\"HUDPaint\", \"MyHUD\", function()\n    local lp = LocalPlayer()\n    local health = lp:Health()\n\n    draw.SimpleText(\"HP: \" .. health, \"Trebuchet24\", 20, 20, color_white)\n    draw.SimpleText(\"Health: \" .. health, \"Trebuchet24\", 20, 40, color_white)\n    draw.RoundedBox(4, 20, 60, health * 2, 16, color_red)\nend)\n``` \nReason: Cache `LocalPlayer()` and `:Health()` once per frame instead of calling `LocalPlayer():Health()` three times.","model_patch":"```lua\nhook.Add(\"HUDPaint\", \"MyHUD\", function()\n    local lp = LocalPlayer()\n    local health = lp:Health()\n\n    draw.SimpleText(\"HP: \" .. health, \"Trebuchet24\", 20, 20, color_white)\n    draw.SimpleText(\"Health: \" .. health, \"Trebuchet24\", 20, 40, color_white)\n    draw.RoundedBox(4, 20, 60, health * 2, 16, color_red)\nend)\n``` \nReason: Cache `LocalPlayer()` and `:Health()` once per frame instead of calling `LocalPlayer():Health()` three times."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-color.v1","fixtureId":"gmod.perf.local-color.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"16a7bed1b931d467","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12903,"startedAt":"2026-07-10T17:27:29.648Z","completedAt":"2026-07-10T17:27:42.553Z","answerBytes":295,"answerChars":295,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":74,"totalTokens":137,"source":"estimated"},"finalResponse":"```lua\nlocal WHITE = color_white\n\nhook.Add(\"HUDPaint\", \"FastPaintExample\", function()\n    surface.SetDrawColor(WHITE)\n    surface.DrawRect(10, 10, 100, 20)\nend)\n``` \nReason: `Color(255,255,255)` allocates a new color table; reusing `color_white` or a cached local avoids that per-iteration work.","model_patch":"```lua\nlocal WHITE = color_white\n\nhook.Add(\"HUDPaint\", \"FastPaintExample\", function()\n    surface.SetDrawColor(WHITE)\n    surface.DrawRect(10, 10, 100, 20)\nend)\n``` \nReason: `Color(255,255,255)` allocates a new color table; reusing `color_white` or a cached local avoids that per-iteration work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.local-vs-global.v1","fixtureId":"gmod.perf.local-vs-global.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"c116d8c651190647","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":8887,"startedAt":"2026-07-10T17:27:30.527Z","completedAt":"2026-07-10T17:27:39.415Z","answerBytes":171,"answerChars":171,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":43,"totalTokens":105,"source":"estimated"},"finalResponse":"```lua\nlocal sin = math.sin\n\nfor i = 1, n do\n    sum = sum + sin(i)\nend\n```\nReason: caching `math.sin` in a local avoids repeated global/table lookups inside the hot loop.","model_patch":"```lua\nlocal sin = math.sin\n\nfor i = 1, n do\n    sum = sum + sin(i)\nend\n```\nReason: caching `math.sin` in a local avoids repeated global/table lookups inside the hot loop."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.localplayer-cache.v1","fixtureId":"gmod.perf.localplayer-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7398105af47b079e","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":25613,"startedAt":"2026-07-10T17:27:30.783Z","completedAt":"2026-07-10T17:27:56.397Z","answerBytes":458,"answerChars":458,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":115,"totalTokens":185,"source":"estimated"},"finalResponse":"```lua\nlocal LocalPlayer = LocalPlayer\n\nhook.Add(\"HUDPaint\", \"FastLocalPlayer\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    -- Reuse lp instead of calling LocalPlayer() repeatedly.\n    if lp:Alive() then\n        -- hot-path logic here\n    end\nend)\n``` \nReason: `LocalPlayer` is cached as a local upvalue, and the player entity is fetched once per hot path so the same `lp` value can be reused without repeated lookups.","model_patch":"```lua\nlocal LocalPlayer = LocalPlayer\n\nhook.Add(\"HUDPaint\", \"FastLocalPlayer\", function()\n    local lp = LocalPlayer()\n    if not IsValid(lp) then return end\n\n    -- Reuse lp instead of calling LocalPlayer() repeatedly.\n    if lp:Alive() then\n        -- hot-path logic here\n    end\nend)\n``` \nReason: `LocalPlayer` is cached as a local upvalue, and the player entity is fetched once per hot path so the same `lp` value can be reused without repeated lookups."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.looking-at.v1","fixtureId":"gmod.perf.looking-at.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"20b22f678a4b08d7","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"partial","detail":"Matched a partial-answer pattern.","durationMs":61917,"startedAt":"2026-07-10T17:27:30.946Z","completedAt":"2026-07-10T17:28:32.864Z","answerBytes":468,"answerChars":467,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":91,"completionTokens":117,"totalTokens":208,"source":"estimated"},"finalResponse":"```lua\nlocal LOOK_DOT = 0.70710678 -- cos(45°); raise for stricter, lower for looser\n\nlocal function LookingAtEachOther(a, b)\n    if not IsValid(a) or not IsValid(b) then return false end\n\n    local ab = b:EyePos() - a:EyePos()\n    ab:Normalize()\n\n    return a:GetAimVector():Dot(ab) >= LOOK_DOT\n       and b:GetAimVector():Dot(-ab) >= LOOK_DOT\nend\n``` \nReason: Dot products measure alignment directly, so you avoid `math.acos` and keep the check to a few vector ops.","model_patch":"```lua\nlocal LOOK_DOT = 0.70710678 -- cos(45°); raise for stricter, lower for looser\n\nlocal function LookingAtEachOther(a, b)\n    if not IsValid(a) or not IsValid(b) then return false end\n\n    local ab = b:EyePos() - a:EyePos()\n    ab:Normalize()\n\n    return a:GetAimVector():Dot(ab) >= LOOK_DOT\n       and b:GetAimVector():Dot(-ab) >= LOOK_DOT\nend\n``` \nReason: Dot products measure alignment directly, so you avoid `math.acos` and keep the check to a few vector ops."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.meta-vs-arg.v1","fixtureId":"gmod.perf.meta-vs-arg.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de332f7356830dfa","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":24924,"startedAt":"2026-07-10T17:27:31.671Z","completedAt":"2026-07-10T17:27:56.596Z","answerBytes":237,"answerChars":237,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":60,"totalTokens":131,"source":"estimated"},"finalResponse":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally a little faster and clearer for a helper you control because it avoids method-style lookup/sugar; the difference is tiny, but the plain function call is the leaner choice.","model_patch":"```lua\nSomeHelper(ply)\n```\nReason: `SomeHelper(ply)` is generally a little faster and clearer for a helper you control because it avoids method-style lookup/sugar; the difference is tiny, but the plain function call is the leaner choice."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.msg-vs-print.v1","fixtureId":"gmod.perf.msg-vs-print.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"6cbb4e4b2f19dd24","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":46851,"startedAt":"2026-07-10T17:27:32.143Z","completedAt":"2026-07-10T17:28:18.996Z","answerBytes":163,"answerChars":163,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":41,"totalTokens":104,"source":"estimated"},"finalResponse":"```lua\nMsgN(\"debug: \", value)\n```\nReason: `MsgN` is the direct console output primitive in Garry's Mod, so it avoids `print`'s extra formatting work in a hot path.","model_patch":"```lua\nMsgN(\"debug: \", value)\n```\nReason: `MsgN` is the direct console output primitive in Garry's Mod, so it avoids `print`'s extra formatting work in a hot path."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.pairs-ipairs-for.v1","fixtureId":"gmod.perf.pairs-ipairs-for.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"de5e4875fcf3e600","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":9100,"startedAt":"2026-07-10T17:27:33.775Z","completedAt":"2026-07-10T17:27:42.877Z","answerBytes":264,"answerChars":264,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":66,"totalTokens":139,"source":"estimated"},"finalResponse":"```lua\nlocal sum = 0\nlocal n = #t\n\nfor i = 1, n do\n    sum = sum + t[i]\nend\n```\nReason: Numeric `for` is typically fastest for a dense sequential array in Garry's Mod Lua; `ipairs` adds iterator overhead and `pairs` is the slowest and least predictable for arrays.","model_patch":"```lua\nlocal sum = 0\nlocal n = #t\n\nfor i = 1, n do\n    sum = sum + t[i]\nend\n```\nReason: Numeric `for` is typically fastest for a dense sequential array in Garry's Mod Lua; `ipairs` adds iterator overhead and `pairs` is the slowest and least predictable for arrays."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.plain-lua-vs-fn.v1","fixtureId":"gmod.perf.plain-lua-vs-fn.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"ead0a98b3ff6a388","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":11717,"startedAt":"2026-07-10T17:27:34.361Z","completedAt":"2026-07-10T17:27:46.079Z","answerBytes":595,"answerChars":595,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":149,"totalTokens":225,"source":"estimated"},"finalResponse":"```lua\nlocal function fastFilterMap(src, predicate, mapper)\n    local out = {}\n    local n = 0\n\n    for i = 1, #src do\n        local v = src[i]\n        if predicate(v) then\n            n = n + 1\n            out[n] = mapper(v)\n        end\n    end\n\n    return out\nend\n\n-- Example: keep active players and map to their job names.\nlocal jobNames = fastFilterMap(players, function(p)\n    return IsValid(p) and p:Alive()\nend, function(p)\n    return p:getDarkRPVar(\"job\")\nend)\n``` \nReason: one pass, no intermediate tables, and fewer closure/combinator calls than chaining DarkRP fn filter/map helpers.","model_patch":"```lua\nlocal function fastFilterMap(src, predicate, mapper)\n    local out = {}\n    local n = 0\n\n    for i = 1, #src do\n        local v = src[i]\n        if predicate(v) then\n            n = n + 1\n            out[n] = mapper(v)\n        end\n    end\n\n    return out\nend\n\n-- Example: keep active players and map to their job names.\nlocal jobNames = fastFilterMap(players, function(p)\n    return IsValid(p) and p:Alive()\nend, function(p)\n    return p:getDarkRPVar(\"job\")\nend)\n``` \nReason: one pass, no intermediate tables, and fewer closure/combinator calls than chaining DarkRP fn filter/map helpers."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.player-cache-hooks.v1","fixtureId":"gmod.perf.player-cache-hooks.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"a834817afe9e6c25","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":111113,"startedAt":"2026-07-10T17:27:34.881Z","completedAt":"2026-07-10T17:29:25.996Z","answerBytes":812,"answerChars":812,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":88,"completionTokens":203,"totalTokens":291,"source":"estimated"},"finalResponse":"```lua\nif SERVER then\n    local cachedPlayers = player.GetAll()\n    local playersDirty = false\n\n    local function InvalidatePlayerCache()\n        playersDirty = true\n    end\n\n    hook.Add(\"PlayerInitialSpawn\", \"PlayerCacheJoin\", InvalidatePlayerCache)\n    hook.Add(\"PlayerDisconnected\", \"PlayerCacheLeave\", InvalidatePlayerCache)\n\n    hook.Add(\"Tick\", \"UseCachedPlayers\", function()\n        if playersDirty then\n            cachedPlayers = player.GetAll()\n            playersDirty = false\n        end\n\n        for i = 1, #cachedPlayers do\n            local ply = cachedPlayers[i]\n            -- per-player work here\n        end\n    end)\nend\n``` \nReason: `player.GetAll()` now runs only after a join or leave marks the cache dirty, so the per-tick hook reuses the same table instead of rebuilding it every frame.","model_patch":"```lua\nif SERVER then\n    local cachedPlayers = player.GetAll()\n    local playersDirty = false\n\n    local function InvalidatePlayerCache()\n        playersDirty = true\n    end\n\n    hook.Add(\"PlayerInitialSpawn\", \"PlayerCacheJoin\", InvalidatePlayerCache)\n    hook.Add(\"PlayerDisconnected\", \"PlayerCacheLeave\", InvalidatePlayerCache)\n\n    hook.Add(\"Tick\", \"UseCachedPlayers\", function()\n        if playersDirty then\n            cachedPlayers = player.GetAll()\n            playersDirty = false\n        end\n\n        for i = 1, #cachedPlayers do\n            local ply = cachedPlayers[i]\n            -- per-player work here\n        end\n    end)\nend\n``` \nReason: `player.GetAll()` now runs only after a join or leave marks the cache dirty, so the per-tick hook reuses the same table instead of rebuilding it every frame."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.ply-table-index.v1","fixtureId":"gmod.perf.ply-table-index.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f18cc80df8999147","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":29187,"startedAt":"2026-07-10T17:27:36.468Z","completedAt":"2026-07-10T17:28:05.657Z","answerBytes":520,"answerChars":520,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":69,"completionTokens":130,"totalTokens":199,"source":"estimated"},"finalResponse":"```lua\nlocal PlayerTemp = setmetatable({}, { __mode = \"k\" }) -- weak keys so removed players do not leak\n\nlocal function SetTemp(ply, value)\n    PlayerTemp[ply] = value\nend\n\nlocal function GetTemp(ply)\n    return PlayerTemp[ply]\nend\n\n-- usage\nSetTemp(ply, {\n    someField = value\n})\n\nlocal temp = GetTemp(ply)\nlocal field = temp and temp.someField\n``` \nReason: a plain upvalue table lookup is cheaper than going through `ply.someField`, and weak keys keep temporary per-player data from leaking after the player is gone.","model_patch":"```lua\nlocal PlayerTemp = setmetatable({}, { __mode = \"k\" }) -- weak keys so removed players do not leak\n\nlocal function SetTemp(ply, value)\n    PlayerTemp[ply] = value\nend\n\nlocal function GetTemp(ply)\n    return PlayerTemp[ply]\nend\n\n-- usage\nSetTemp(ply, {\n    someField = value\n})\n\nlocal temp = GetTemp(ply)\nlocal field = temp and temp.someField\n``` \nReason: a plain upvalue table lookup is cheaper than going through `ply.someField`, and weak keys keep temporary per-player data from leaking after the player is gone."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.seq-tables.v1","fixtureId":"gmod.perf.seq-tables.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4778b0220c3f91a3","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":12191,"startedAt":"2026-07-10T17:27:37.961Z","completedAt":"2026-07-10T17:27:50.154Z","answerBytes":389,"answerChars":389,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":79,"completionTokens":98,"totalTokens":177,"source":"estimated"},"finalResponse":"```lua\n-- Faster for iteration: sequential numeric array\nlocal values = {\n    \"health\",\n    \"armor\",\n    \"speed\",\n    \"ammo\",\n}\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n``` \nReason: Sequential number-indexed arrays are faster to iterate than string-keyed maps because Lua can traverse the array part with simple indexed access instead of hashing string keys.","model_patch":"```lua\n-- Faster for iteration: sequential numeric array\nlocal values = {\n    \"health\",\n    \"armor\",\n    \"speed\",\n    \"ammo\",\n}\n\nfor i = 1, #values do\n    local value = values[i]\n    -- use value\nend\n``` \nReason: Sequential number-indexed arrays are faster to iterate than string-keyed maps because Lua can traverse the array part with simple indexed access instead of hashing string keys."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.setdrawcolor-split.v1","fixtureId":"gmod.perf.setdrawcolor-split.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"d110fde8a37bbe59","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":16405,"startedAt":"2026-07-10T17:27:39.416Z","completedAt":"2026-07-10T17:27:55.822Z","answerBytes":132,"answerChars":132,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":71,"completionTokens":33,"totalTokens":104,"source":"estimated"},"finalResponse":"```lua\nsurface.SetDrawColor(r, g, b, a)\n```\nReason: Raw numeric arguments are the faster hot-path style than passing a Color object.","model_patch":"```lua\nsurface.SetDrawColor(r, g, b, a)\n```\nReason: Raw numeric arguments are the faster hot-path style than passing a Color object."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.sqlite-vs-mysql.v1","fixtureId":"gmod.perf.sqlite-vs-mysql.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"4a3f5d2a20d71ac9","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":10599,"startedAt":"2026-07-10T17:27:40.287Z","completedAt":"2026-07-10T17:27:50.888Z","answerBytes":292,"answerChars":292,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":100,"completionTokens":73,"totalTokens":173,"source":"estimated"},"finalResponse":"```lua\nlocal rows = sql.Query(\"SELECT * FROM player_data WHERE steamid = \" .. sql.SQLStr(steamid))\n```\nReason: Local SQLite is usually lower latency for a single Garry's Mod server because it stays on the same machine and avoids the network round trip and remote connection overhead of MySQL.","model_patch":"```lua\nlocal rows = sql.Query(\"SELECT * FROM player_data WHERE steamid = \" .. sql.SQLStr(steamid))\n```\nReason: Local SQLite is usually lower latency for a single Garry's Mod server because it stays on the same machine and avoids the network round trip and remote connection overhead of MySQL."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.steamid-cache.v1","fixtureId":"gmod.perf.steamid-cache.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"e8a94aa454154982","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":40856,"startedAt":"2026-07-10T17:27:40.476Z","completedAt":"2026-07-10T17:28:21.334Z","answerBytes":531,"answerChars":531,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":63,"completionTokens":133,"totalTokens":196,"source":"estimated"},"finalResponse":"```lua\nlocal steamid_cache = {}\n\nlocal function SteamIDCached(ply)\n    local sid = steamid_cache[ply]\n    if sid == nil then\n        sid = ply:SteamID()\n        steamid_cache[ply] = sid\n    end\n    return sid\nend\n\nhook.Add(\"PlayerDisconnected\", \"SteamIDCached_Clear\", function(ply)\n    steamid_cache[ply] = nil\nend)\n\n-- hot path\nlocal sid = SteamIDCached(ply)\nif sid == target_sid then\n    -- ...\nend\n```\nReason: memoizes the SteamID per player so repeated hot-path checks do a table lookup instead of calling into GMod every time.","model_patch":"```lua\nlocal steamid_cache = {}\n\nlocal function SteamIDCached(ply)\n    local sid = steamid_cache[ply]\n    if sid == nil then\n        sid = ply:SteamID()\n        steamid_cache[ply] = sid\n    end\n    return sid\nend\n\nhook.Add(\"PlayerDisconnected\", \"SteamIDCached_Clear\", function(ply)\n    steamid_cache[ply] = nil\nend)\n\n-- hot path\nlocal sid = SteamIDCached(ply)\nif sid == target_sid then\n    -- ...\nend\n```\nReason: memoizes the SteamID per player so repeated hot-path checks do a table lookup instead of calling into GMod every time."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.string-table-concat.v1","fixtureId":"gmod.perf.string-table-concat.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"b0cf9e04ae7c5dd9","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":14132,"startedAt":"2026-07-10T17:27:41.905Z","completedAt":"2026-07-10T17:27:56.039Z","answerBytes":386,"answerChars":386,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14546,"completionTokens":652,"totalTokens":15198,"reasoningTokens":516,"cachedTokens":13824},"finalResponse":"```lua\n-- Slow: repeated .. concatenation copies the whole string over and over.\n-- local s = \"\"\n-- for i = 1, n do\n--   s = s .. chunks[i]\n-- end\n\nlocal parts = {}\nfor i = 1, n do\n  parts[i] = chunks[i]\nend\n\nlocal s = table.concat(parts)\n``` \nReason: `table.concat` builds the final string in one pass, so it avoids the repeated reallocations and copying that make `..` in a loop slow.","model_patch":"```lua\n-- Slow: repeated .. concatenation copies the whole string over and over.\n-- local s = \"\"\n-- for i = 1, n do\n--   s = s .. chunks[i]\n-- end\n\nlocal parts = {}\nfor i = 1, n do\n  parts[i] = chunks[i]\nend\n\nlocal s = table.concat(parts)\n``` \nReason: `table.concat` builds the final string in one pass, so it avoids the repeated reallocations and copying that make `..` in a loop slow."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-drawrect.v1","fixtureId":"gmod.perf.surface-drawrect.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"696e8de769d9ad0e","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":10319,"startedAt":"2026-07-10T17:27:41.984Z","completedAt":"2026-07-10T17:27:52.304Z","answerBytes":199,"answerChars":199,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":69,"completionTokens":50,"totalTokens":119,"source":"estimated"},"finalResponse":"```lua\nsurface.SetDrawColor(color)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` draws a plain rectangle directly, so it avoids the extra rounded-box logic in `draw.RoundedBox(0, ...)`.","model_patch":"```lua\nsurface.SetDrawColor(color)\nsurface.DrawRect(x, y, w, h)\n```\nReason: `surface.DrawRect` draws a plain rectangle directly, so it avoids the extra rounded-box logic in `draw.RoundedBox(0, ...)`."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.surface-text.v1","fixtureId":"gmod.perf.surface-text.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"95d9fe4918ee4197","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":32271,"startedAt":"2026-07-10T17:27:42.553Z","completedAt":"2026-07-10T17:28:14.826Z","answerBytes":457,"answerChars":457,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":76,"completionTokens":115,"totalTokens":191,"source":"estimated"},"finalResponse":"```lua\nlocal font = \"Trebuchet24\"\nlocal text = \"Hello world\"\n\nhook.Add(\"HUDPaint\", \"FastTextExample\", function()\n    surface.SetFont(font)\n    surface.SetTextColor(255, 255, 255, 255)\n    surface.SetTextPos(100, 100)\n    surface.DrawText(text)\nend)\n```\nReason: `surface.DrawText` with the `surface.*` setup calls is the lowest-overhead path for plain single-line text; `draw.DrawText` and `SimpleTextOutlined` add extra wrapper, alignment, and outline work.","model_patch":"```lua\nlocal font = \"Trebuchet24\"\nlocal text = \"Hello world\"\n\nhook.Add(\"HUDPaint\", \"FastTextExample\", function()\n    surface.SetFont(font)\n    surface.SetTextColor(255, 255, 255, 255)\n    surface.SetTextPos(100, 100)\n    surface.DrawText(text)\nend)\n```\nReason: `surface.DrawText` with the `surface.*` setup calls is the lowest-overhead path for plain single-line text; `draw.DrawText` and `SimpleTextOutlined` add extra wrapper, alignment, and outline work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-count-hash.v1","fixtureId":"gmod.perf.table-count-hash.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3e9bbfc8452e05e3","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":6624,"startedAt":"2026-07-10T17:27:42.877Z","completedAt":"2026-07-10T17:27:49.503Z","answerBytes":116,"answerChars":116,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":62,"completionTokens":29,"totalTokens":91,"source":"estimated"},"finalResponse":"```lua\nlocal len = #myTable\n```\nReason: `#` is the standard length operator for sequential array-like tables in Lua.","model_patch":"```lua\nlocal len = #myTable\n```\nReason: `#` is the standard length operator for sequential array-like tables in Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-empty.v1","fixtureId":"gmod.perf.table-empty.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"3a6344977f5bd475","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":10811,"startedAt":"2026-07-10T17:27:46.080Z","completedAt":"2026-07-10T17:27:56.893Z","answerBytes":250,"answerChars":250,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":73,"completionTokens":63,"totalTokens":136,"source":"estimated"},"finalResponse":"```lua\nt = {}\n```\nReason: `t = {}` is generally faster because it drops the old table and makes a fresh empty one, while `table.Empty(t)` has to walk and clear the existing table; use `table.Empty(t)` only if other code still holds that table object.","model_patch":"```lua\nt = {}\n```\nReason: `t = {}` is generally faster because it drops the old table and makes a fresh empty one, while `table.Empty(t)` has to walk and clear the existing table; use `table.Empty(t)` only if other code still holds that table object."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-hasvalue.v1","fixtureId":"gmod.perf.table-hasvalue.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"7d064428a873fdfc","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"protocol_error","detail":"Answer must contain 0 through 0 candidate loops.","durationMs":10660,"startedAt":"2026-07-10T17:27:49.503Z","completedAt":"2026-07-10T17:28:00.165Z","answerBytes":296,"answerChars":296,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"source":"provider","promptTokens":14546,"completionTokens":628,"totalTokens":15174,"reasoningTokens":516,"cachedTokens":13824},"finalResponse":"```lua\nlocal list = { \"weapon_pistol\", \"weapon_smg1\", \"weapon_ar2\" }\nlocal set = {}\n\nfor _, v in ipairs(list) do\n    set[v] = true\nend\n\nif set[weaponClass] then\n    -- value exists in the set\nend\n``` \nReason: direct table lookup is O(1) on average, while `table.HasValue` scans the list linearly.","model_patch":"```lua\nlocal list = { \"weapon_pistol\", \"weapon_smg1\", \"weapon_ar2\" }\nlocal set = {}\n\nfor _, v in ipairs(list) do\n    set[v] = true\nend\n\nif set[weaponClass] then\n    -- value exists in the set\nend\n``` \nReason: direct table lookup is O(1) on average, while `table.HasValue` scans the list linearly."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-literal.v1","fixtureId":"gmod.perf.table-literal.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f95a8fc610d720ad","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":23787,"startedAt":"2026-07-10T17:27:50.154Z","completedAt":"2026-07-10T17:28:13.943Z","answerBytes":166,"answerChars":166,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":70,"completionTokens":42,"totalTokens":112,"source":"estimated"},"finalResponse":"```lua\nlocal t = { x = 1, y = 2, z = 3 }\n```\nReason: The table constructor creates and fills the table in one step, while assigning fields after `{}` does extra work.","model_patch":"```lua\nlocal t = { x = 1, y = 2, z = 3 }\n```\nReason: The table constructor creates and fills the table in one step, while assigning fields after `{}` does extra work."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.table-random.v1","fixtureId":"gmod.perf.table-random.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"f3e090701953d4a9","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"incorrect","detail":"Did not match a fixture answer pattern.","durationMs":10653,"startedAt":"2026-07-10T17:27:50.889Z","completedAt":"2026-07-10T17:28:01.544Z","answerBytes":257,"answerChars":257,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":66,"completionTokens":65,"totalTokens":131,"source":"estimated"},"finalResponse":"```lua\nlocal function FastRandom(t)\n    local n = #t\n    if n == 0 then return nil end\n    return t[math.random(n)]\nend\n``` \nReason: For a sequential array, `#t` plus direct indexing avoids the extra work `table.Random` does to handle non-sequential tables.","model_patch":"```lua\nlocal function FastRandom(t)\n    local n = #t\n    if n == 0 then return nil end\n    return t[math.random(n)]\nend\n``` \nReason: For a sequential array, `#t` plus direct indexing avoids the extra work `table.Random` does to handle non-sequential tables."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.perf.x-times-x.v1","fixtureId":"gmod.perf.x-times-x.v1","fixtureVersion":1,"rubricVersion":"1","promptHash":"79d48008f6b5174f","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"pass","detail":"Matched a pass pattern.","durationMs":5905,"startedAt":"2026-07-10T17:27:51.703Z","completedAt":"2026-07-10T17:27:57.611Z","answerBytes":129,"answerChars":129,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":58,"completionTokens":33,"totalTokens":91,"source":"estimated"},"finalResponse":"```lua\nlocal y = x * x\n```\nReason: `x * x` avoids function-call overhead and is the fastest simple way to square a number in Lua.","model_patch":"```lua\nlocal y = x * x\n```\nReason: `x * x` avoids function-call overhead and is the fastest simple way to square a number in Lua."}
{"runId":"6d5384a1-ae22-496a-83dd-92c789967f27","instance_id":"gmod.player-iterator.v1","fixtureId":"gmod.player-iterator.v1","fixtureVersion":2,"rubricVersion":"4","promptHash":"fe3d7469535a0ca2","adapterId":"codex","model":"gpt-5.4-mini@xhigh","model_name_or_path":"gpt-5.4-mini@xhigh","attemptIndex":1,"status":"partial","detail":"Uses ipairs but still allocates via player.GetAll() each time.","durationMs":7160,"startedAt":"2026-07-10T17:27:52.305Z","completedAt":"2026-07-10T17:27:59.466Z","answerBytes":190,"answerChars":190,"httpStatus":null,"httpAttempts":null,"exitCode":0,"usage":{"promptTokens":80,"completionTokens":48,"totalTokens":128,"source":"estimated"},"finalResponse":"```lua\nfor _, ply in ipairs(player.GetAll()) do\n    -- visit ply here\nend\n```\nReason: `player.GetAll()` returns an array-like list of connected players, so `ipairs` visits each one in order.","model_patch":"```lua\nfor _, ply in ipairs(player.GetAll()) do\n    -- visit ply here\nend\n```\nReason: `player.GetAll()` returns an array-like list of connected players, so `ipairs` visits each one in order."}
