determinism

determinism is a skill for Claude Code, Codex from plausibleventures/lattice. It costs 77 tokens per session (2,919 once invoked), scanned A, original, MIT.

A guide for making a game deterministic, meaning the same starting seed and player inputs produce the same result each time.

In plain words
What is it for?
Use it when debugging replay mismatches, save files, world regeneration, cross-device results, or decisions about which calculations may be stored or hashed.
Why use it?
It helps find differences between replays, machines, browsers, and regenerated worlds, including differences caused by unsafe maths or changing iteration order.

Skill for Claude CodeCodex

Part of the lattice plugin — 12 skills, 1 command, 6 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/plausibleventures/lattice/determinism
Any agent
npx skills add plausibleventures/lattice --skill determinism
Clone the repo
git clone --depth 1 https://github.com/plausibleventures/lattice

Made for: Claude Code, Codex.

Or install lattice, the plugin that ships this one along with the rest of its 12 skills, 1 command, 6 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for determinism

README.md
[![agentmods](https://agentmods.dev/badge/skills/plausibleventures/lattice/determinism.svg)](https://agentmods.dev/skills/plausibleventures/lattice/determinism)
Your own site
<a href="https://agentmods.dev/skills/plausibleventures/lattice/determinism"><img src="https://agentmods.dev/badge/skills/plausibleventures/lattice/determinism.svg" alt="Measured on agentmods" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,919 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00077 $0.02919
Opus 5 $0.00039 $0.01460
Sonnet 5 $0.00015 $0.00584
Haiku 4.5 $0.00008 $0.00292

Measured 4d ago against content hash e265ffd3c8e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

determinism scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/determinism/SKILL.md · 233 lines

How it starts

The opening of the file, as written. The whole thing — 233 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Determinism

The claim this kit makes is that a session can be replayed from a seed and an input log and land on the same pixel. That is a real property with real edges, and most of the ways it breaks are things nobody would guess.


Two tiers, because the language only promises one

ECMA-262 specifies + - * /, Math.sqrt, Math.imul and the bitwise operators exactly. It explicitly does not require sin, cos, pow, exp or log to be correctly rounded, so two conforming engines may disagree in the last bit.

arithmetic promise may reach
Tier A + - * /, sqrt, imul, bitwise, abs/min/max/floor/round bit-identical on every engine hashes, save files, replays, anything
Tier B sin, cos, atan2, pow, exp, log correct to within an ulp or so pixels only — never hashed, never persisted

Tier B is not banned; a cost curve is b · r^k and there is no honest way around that. What it must not do is reach a save file or a hash.

Consequences you will meet:

  • There are no sine or expo easings anywhere in the kit. A tween drives a position, a position gets written to a save, and the save no longer replays.
  • Pick a dyadic offline exponent. 0.5, 0.625 and 0.75 are computed as a chain of Math.sqrt and multiplies, so credited time is Tier A for free. 0.6 is three per cent stingier than 0.625 and a whole determinism tier worse.
  • Path costs are integers — the octile metric 14·min(dx,dy) + 10·|dx−dy|, exact and admissible with no sqrt. Float summation is associative only by luck, so two engines can pop equal-cost nodes in a different order and return different — both optimal, both different — routes.
  • SEMITONE exists so a game need not call pow for a musical interval.

The one place the tier rule bites hardest is a field that feeds itself. A height field being eroded is state that feeds the next step, so a last-bit disagreement in one pow is amplified by the next droplet that steers on the gradient it perturbed — and after a hundred thousand iterations two conforming engines have the river in a different valley. In a loop like that, use only Tier A arithmetic and do not bother tagging anything as presentation, because every value in the file reaches the next iteration.

Read the full file on GitHub · 233 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 233 lines · 77 tokens per session scan A e265ffd3c8e6

Subscribe to this mod's changes

determinism is a skill published in the GitHub repository plausibleventures/lattice (35 stars, last pushed 12d ago), licensed MIT. It adds 77 tokens to every session and 2,919 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.