Perplexity AI: Perplexity. What do you think of using the general concept
of tbe reversibility of physical laws to make a tiny, highly bounded time
travel simulation? Something simple enough that it's clear and direct how
to do it. First we'd make a simple simulation independent of the direction
of time, then after doing that we'd add a way for something, like a
character agent, to move to different points in time. Then we could either
iterate the simulation to make time consistent, or track many diverging
branches. Has anybody done this already? Do you think it would be
reasonable to do it with short and simple code? https://www.perplexity.ai/
search/perplexity-what-do-you-think-o-e.dbSvyoQgaxoMpWcsJmVQ#0
# Perplexity. What do you think of using the general concept of tbe
reversibility of physical laws to make a tiny, highly bounded time travel
simulation? Something simple enough that it's clear and direct how to do
it. First we'd make a simple simulation independent of the direction of
time, then after doing that we'd add a way for something, like a character
agent, to move to different points in time. Then we could either iterate
the simulation to make time consistent, or track many diverging branches.
Has anybody done this already? Do you think it would be reasonable to do it
with short and simple code?
Great question—and **yes, absolutely.** This is deeply tractable, people
have done it, and it doesn't require enormous amounts of code.
## Existing Work
You're in luck: this concept already has several concrete implementations:
**Mariposa** (ambulancja/mariposa on GitHub) is the most directly
relevant—it's a toy programming language that explores exactly this. It's
beautifully minimal. The core idea: capture "instants" with `now()`, then
use `at t:` to jump back and retroactively modify state. The interpreter
maintains a timeline and handles the consistency automatically. It
demonstrates that the fundamental mechanics aren't complex.
**Loro Time Travel Demo** (loro-dev/loro-time-travel-demo) shows it working
in just ~100 lines of code, focusing on concurrent data structures with
time travel built in.
**Reversible Cellular Automata** (dmishin/js-revca) takes the physics-first
approach—mathematically invertible transition rules that can run forward or
backward perfectly. This is elegant because reversibility is baked into the
rules themselves.
## Why It's Reasonable
Your instinct is sound. Here's why simple code is plausible:
1. **You don't need to solve paradoxes perfectly.** You just need to pick a
coherent model:
- **Branching timelines**: Agent changes the past → you fork a new
branch. Simple: store snapshots, re-simulate forward from the change point.
- **Iterative consistency**: Agent edits past state, you propagate
changes forward and backward until nothing changes (fixed point).
Surprisingly convergent in practice.
- **Constraint satisfaction**: Recent physics work (Tobar \& Costa,
2025) proves paradox-free time travel is mathematically feasible if you
allow the agent freedom *within bounds*. You could enforce this
automatically.
2. **The core mechanics are minimal:** Timeline tracking + state snapshots
+ directional simulation.
3. **Simple physics = simple code.** Start with particles on a grid,
elastic collisions, gravity. All reversible. A basic Verlet integrator that
stores positions runs backward perfectly if you negate velocities.
## A Strawman Architecture
```
Timeline = list of (time, world_state)
Agent = (position, time)
Forward():
Apply physics rules to current state
Store (t+dt, new_state) in timeline
Backward():
Look up previous state from timeline
Agent jumps to it
Re-simulate forward with agent at new position
Detect changes to future branch
Either iterate until fixed or fork branch
TimeTravel(agent, target_time):
Load world_state from Timeline[target_time]
Allow agent to modify (edit particles, etc.)
Call Backward() to propagate changes
```
That's it. Maybe 200–400 lines depending on your physics engine and whether
you want visualization.
## What Makes It Tractable
- **Reversibility is free if you design for it**: Don't use one-way
functions. Store enough state (positions + velocities, not just velocities).
- **Branching is just copying**: Branch = fork the timeline list from that
point onward. No deep magic.
- **Consistency is automatic in reversible physics**: If your rules are
truly symmetric in time, running backward is mechanically identical to
running forward with negated velocities. Fixed points emerge naturally.
- **You can start stupidly simple**: 2D grid of cells, agent as a point,
collision detection, gravity as a force. Add visual feedback last.
## The Core Challenge
It's not the mechanics—it's **deciding what "consistent" means for your
application.** Do edits cascade forward? Do they branch? Do you allow
temporal loops? Once you decide that, the code follows naturally.
**The honest limitation**: As you scale to many agents or complex
interactions, tracking consistency across diverging timelines gets
expensive. But for a bounded simulation (small set of particles, short time
window, one agent), this is totally solvable in short code.
My read: start with Mariposa's mental model (timeline + instants),
implement it for a 2D particle system in Python or Rust, and let the
physics structure guide you. I'd bet you hit something functional in < 500
lines.
Does the direction feel right to you, or are you thinking about the agent's
agency differently?
<span
style="display:none">[^1_1][^1_10][^1_11][^1_12][^1_13][^1_14][^1_15][^1_16][^1_17][^1_18][^1_19][^1_2][^1_20][^1_21][^1_22][^1_23][^1_24][^1_25][^1_26][^1_27][^1_28][^1_29][^1_3][^1_30][^1_4][^1_5][^1_6][^1_7][^1_8][^1_9]</span>
<div align="center">⁂</div>
[^1_1]:
https://www.cam.ac.uk/research/news/simulations-of-backwards-time-travel-can-improve-scientific-experiments
[^1_2]: https://pmc.ncbi.nlm.nih.gov/articles/PMC9672348/
[^1_3]: https://portfolio.jbm.fyi/branch-prediction-simulation/
[^1_4]: https://www.youtube.com/watch?v=Ng0Y5k-VQX8
[^1_5]: https://arxiv.org/html/2403.18035v1
[^1_6]: https://www.jspsych.org/v8/overview/timeline/
[^1_7]: https://www.nature.com/articles/s41598-019-40765-6
[^1_8]: https://openreview.net/forum?id=nRHD9fAj10
[^1_9]:
https://wiki.control.fel.cvut.cz/mediawiki/images/9/99/Dp_2024_stefan_jiri.pdf
[^1_10]:
https://www.popularmechanics.com/science/math/a69651575/student-says-paradox-free-time-travel-is-possible-science/
[^1_11]:
https://www.sciencedirect.com/science/article/abs/pii/S0893608025011463
[^1_12]: https://www.youtube.com/watch?v=hl4eiN8ZMJg
[^1_13]: https://phys.org/news/2019-03-physicists-reverse-quantum.html
[^1_14]: https://bid-robot.github.io
[^1_15]: https://1010labs.org/~ajaymt/branch-predictors/
[^1_16]: https://github.com/MITGameLab/OpenRelativity
[^1_17]: https://dmishin.github.io/js-revca/help.html
[^1_18]:
https://www.reddit.com/r/gamedev/comments/uwpxu5/best_way_to_create_and_implement_branching/
[^1_19]: https://github.com/ambulancja/mariposa
[^1_20]:
https://www.univ-orleans.fr/lifo/Members/Jerome.Durand-Lose/Recherche/Publications/1995_LATIN.pdf
[^1_21]: https://martinfowler.com/articles/branching-patterns.html
[^1_22]: https://github.com/marianina8/timetravel
[^1_23]: https://en.wikipedia.org/wiki/Cellular_automaton
[^1_24]: https://gameprogrammingpatterns.com/state.html
[^1_25]: https://github.com/pbock/timetravel
[^1_26]: https://github.com/dmishin/js-revca
[^1_27]:
https://www.gamedeveloper.com/design/how-to-build-branching-narrative-when-you-don-t-have-a-big-budget-
[^1_28]: https://github.com/loro-dev/loro-time-travel-demo
[^1_29]: https://dmishin.github.io/js-revca/index.html
[^1_30]: https://www.sciencedirect.com/science/article/pii/S1875952122000155