FluxTrace

A Functional Programming Time Machine

Syntax Error 2026Shipped October 25, 2026#general
Visit Repo
FluxTrace banner

About

## The problem it solves

FluxTrace is an interactive functional program analysis and debugging environment for a Haskell-like functional language that helps users understand not just what a program does, but also how it reaches its result. It combines step-by-step execution, data-flow visualisation, value tracing, and an interactive timeline to make every stage of a program easier to understand. Its one of the primary features is counterfactual backward solving wherein a user can specify the output they want, explore possible changes to the source code, and verify each fix by running the program again. By combining execution history, value tracing, and backward solving in one browser-based tool, FluxTrace makes functional programs easier to understand and debug.

## PROBLEMS

  • **Hidden execution steps:** Traditional interpreters typically display only the final output, leaving intermediate computations invisible. When a program produces an unexpected result, identifying the exact step where the computation went wrong becomes difficult.
  • **Unclear value origins:** Values in functional programs often pass through multiple transformations and depend on several inputs, operations, and conditions. Tracing a value back to its original source and understanding how it was derived requires manually following these dependencies.
  • **Manual Trial-And-Error for desired output:** Knowing the desired output does not reveal which source values need to change. Developers often have to modify the code, rerun the program, and repeat the process until they find a change that produces the expected result.
  • **Inaccessible execution history:** Once execution moves forward, revisiting a particular intermediate state or understanding the sequence of operations that led to it can be cumbersome. Without a navigable history, inspecting and comparing different stages of execution becomes difficult.

## SOLUTION AND ADDITIONAL FEATURES

  • **Step-by-step visualisation:** Executes programs using small-step reduction, rewriting one expression at a time and highlighting the computation being evaluated. The data-flow visualiser displays lists, intermediate results, and scalar values as connected boxes, making it easier to understand how operations such as `map`, `fold`, `filter`, `reverse`, and `zip` transform data.
  • **Interactive value lineage:** Click any value to explore its ancestors, descendants, and source dependencies. Displays the computation rule, formula, creation step, and source literals responsible for its value, with corresponding literals highlighted in the editor. A chronological value biography shows where the value originated and how it was used throughout execution.
  • **Timeline and execution history:** Preserves intermediate execution states so users can replay the program, navigate between steps, and inspect individual computations. The timeline provides playback controls, adjustable speeds, a scrubber, and rule-coloured markers, making it easy to revisit specific stages without manually reconstructing the execution.
  • **Counterfactual backward solver:** Specify a desired output and let the solver work backwards through supported arithmetic operations, `map`, `fold`, `filter`, `reverse`, `zip`, and `range` offsets to generate candidate source edits. For shared constants, it also uses the secant method to find numerical solutions, helping users explore how alternative inputs or expressions could produce the desired result.
  • **Verified patches:** Every candidate patch is checked by applying it to the source and rerunning the entire program. Failed candidates are marked as rejected, while changes that move an outlier towards neighbouring values can be ranked as *most plausible*. Verified patches can be applied with one click, changed values are highlighted, and the last patch can be undone.
  • **Additional development tools:** Includes a pixel-grid visualiser for two-dimensional lists, multiple program tabs, automatic re-execution after editing, and visual syntax and runtime error reporting. A built-in searchable language reference provides 62 tested examples that display their results and can be opened directly in the editor for experimentation.
  • **Browser-based execution:** Runs the interpreter, visualiser, lineage engine, and counterfactual solver entirely in the browser, without requiring a backend or

![image](https://assets.devfolio.co/content/0e0e9930c3f044d99e076d4430814f67/42f05373-d30a-4e76-a637-22cbb93e3dc8.png)

![image](https://assets.devfolio.co/content/0e0e9930c3f044d99e076d4430814f67/4273712f-9c05-4f66-b691-cfcd22afff87.png)

![image](https://assets.devfolio.co/content/0e0e9930c3f044d99e076d4430814f67/9418a024-cd6f-4836-9dda-c1bb69c74f45.png)database . This keeps the workflow self-contained and allows program execution and patch verification to happen locally.

## Challenges we ran into

CHALLENGES FACED

**1. Handling Decimal Precision and Rounding**

Counterfactual fixes may require decimals, but floating-point arithmetic can produce errors like `0.1 + 0.2 = 0.30000000000000004`. We rounded arithmetic results to 12 significant digits, simplified numerical solutions to the shortest working decimal, and used a `1e-6` tolerance for verification. Candidates that fail verification are rejected.

**2. Preserving Value Provenance**

Substitution during `let` bindings and lambda application can break links to original inputs. We introduced deterministic IDs and provenance metadata with parent links, preserving dependencies across arithmetic, list operations, and conditionals while enabling reliable patch verification.

**3. Verifying Counterfactual Fixes**

Backward solving can generate incorrect candidates when shared constants affect multiple computations or input changes alter `filter` results. We added numerical refinement, rerun the entire program to verify each candidate, reject failed patches, and rank verified fixes using plausibility heuristics.

**4. Resolving Parser Ambiguities**

Multiline `let` bindings could be misinterpreted as function definitions, while expressions such as `f -3` were ambiguous. We introduced explicit layout rules, refined operator precedence and negative-literal parsing, and documented `f (-3)` for passing negative arguments.

**5. Keeping Execution Bounded**

Recording every intermediate state can make large programs slow and produce excessively long timelines. We introduced a 300-step limit, capped `range` at 1,000 elements, and added lightweight execution for faster patch verification while preserving available execution history.

**6. Making Every Value Traceable**

Initially, scalar-only programs lacked data-flow boxes, and conditional results lost their dependency on the condition. We added a dedicated values row, recorded condition dependencies, and introduced projected lineage edges to connect values across invisible intermediate computations.

Screenshots

FluxTrace screenshot 1FluxTrace screenshot 2FluxTrace screenshot 3FluxTrace screenshot 4FluxTrace screenshot 5

Team

From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.