DEV Community

Cover image for The Tick Model
SaptakBhoumik
SaptakBhoumik

Posted on

The Tick Model

Tick Model (WIP)

TL;DR

This is an early-stage model for describing how systems evolve over time using a small set of clearly defined concepts.

It is not complete, not polished, and intentionally minimal.

The long-term goal is to build an Intermediate Representation (IR) on top of this model that can describe system state and evolution in a unified way, and eventually compile down to efficient executable code.

👉 Full notes and handwritten derivation(Leave a star⭐ if you like it):

https://github.com/SaptakBhoumik/Tick


What this is

This project explores a structured way to describe state, change, and interaction in complex systems.

It is not a simulator by itself.

It is not a physics engine.

It is a conceptual foundation meant to sit underneath such systems.

The ideas are intentionally kept simple and general so they can apply across domains like physics, chemistry, multi-agent systems, or simulations.


Core Concepts (as defined in the notes)

State

A state is a collection of state variables that describe a system at a particular moment.

It represents what exists right now.


State Variables

State variables are measurable properties of a system.

Examples:

  • position
  • velocity
  • temperature

They can be:

  • independent
  • derived from other variables
  • constrained by rules

System

A System is a structured entity that contains state.

It represents a meaningful part of the simulation and may itself be composed of smaller systems.


Resource

A resource is a quantifiable entity that must be conserved or accounted for.

Examples:

  • energy
  • mass
  • charge

Resources cannot appear or disappear unless explicitly allowed.


Relations

Relations define how systems are connected or constrained relative to each other.

They express things like:

  • dependency
  • attachment
  • invariants between components

Relations do not act by themselves. They define what must remain true.


Constraints

Constraints are validation rules.

They specify conditions that must always hold for the system to be valid.
If a constraint is violated, the state is invalid.


Agents

Agents are the active part of the system.

They:

  • observe state
  • attempt to modify it
  • operate only during a tick

Agents do not directly bypass rules; they act within them.


Tick

A tick is the fundamental unit of progression.

In one tick:

  1. Agents act
  2. Relations propagate
  3. Constraints are checked
  4. Valid state is committed

Nothing changes outside a tick.


Small Example

Imagine a falling object.

  • State: position, velocity
  • Agent: gravity
  • Constraint: object cannot go below the ground

Each tick:

  1. Gravity updates velocity
  2. Position updates using velocity
  3. Ground constraint clamps the position

This same structure can scale to far more complex systems.


Goal of the Model

The long-term goal is to build an Intermediate Representation (IR) based on this model.

The IR should:

  • Be readable and writable by humans
  • Be structured enough for programs to generate and analyze
  • Be independent of any specific domain
  • Compile down to optimized LLVM code for execution

Status

This is a work in progress.

Many parts are incomplete or loosely defined on purpose.

The goal right now is clarity of structure, not formal completeness.


Links

If you build something using this or find issues with it, feedback is very welcome.

Top comments (0)