semif-api-rocm

SemIf HTTP API and rocm flake
Log | Files | Refs | README | LICENSE

game-fixtures.cjs (972B)


      1 // Generate unguided prompt spot checks without playing the full level:
      2 // node examples/game-fixtures.cjs > /tmp/game-decisions.jsonl
      3 // .venv/bin/python -m semif_api.llama --input /tmp/game-decisions.jsonl
      4 const G = require('./semif-api/src/semif_api/web/game-rules.js');
      5 const cases = [
      6   ['start-run', G.START_X, 4],
      7   ['early-run', 10, 4],
      8   ['one-tick-too-early-run', 11, 4],
      9   ['valid-takeoff-either', 12, 4],
     10   ['last-chance-jump', 13, 4],
     11   ['second-pit-jump', 30, 3],
     12   ['third-pit-jump', 47, 2],
     13   ['past-pits-run', 52, 1],
     14   ['near-flag-run', G.GOAL - 1, 1],
     15 ];
     16 // IDs describe expected actions for the human reader; SemIf's direct_messages
     17 // does not include row IDs in model evidence. x=12 allows either action safely.
     18 for (const [id, x, jumpsLeft] of cases) {
     19   const player = { x, y: G.GROUND, vy: 0, onGround: true };
     20   console.log(JSON.stringify({
     21     id, state: G.stateText(player, jumpsLeft, false), question: G.QUESTION, options: G.OPTIONS,
     22   }));
     23 }