T81 Foundation

Demo Gallery

Table of Contents

This page lists the runnable demos and utilities available in the repository, giving you quick pointers to the content mentioned elsewhere.

1. CLI Demos

Compile and run both manually using ./build/t81 or with the helper below.

2. Automation Script

../../scripts/run-demos.sh compiles both examples and runs the resulting TISC programs sequentially, printing the CLI output for each.

../../scripts/run-demos.sh

Set WEIGHTS_MODEL=/path/to/model.t81w before running the script if you want it to include ../../examples/weights_load_demo.t81. The script passes the flag through t81 compile ... --weights-model when the file exists.

3. IR/VM Introspection

./build/ir_inspector ../../examples/match_demo.t81

The tool runs the usual frontend pipeline (lexer → parser → semantic analyzer → IR generator) and emits each tisc::ir::Instruction with operand values, making it easy to see how match lowers before the HanoiVM executes anything.

This tool walks the usual frontend pipeline (lexer → parser → semantic analyzer → IR generator) and dumps the resulting tisc::ir::Instruction list with operand types and primitive annotations. Comparisons now carry ComparisonRelation metadata so the inspector makes it easy to verify when the emitter will produce the new Less, Equal, etc., boolean opcodes instead of flag-only CMP sequences.

Axion Loop Trace

Follow the Axion Loop Metadata Example in vm-opcodes.md to see how allocator ops (StackAlloc/StackFree) and loop hints end up in the Hanoi policy text. Compile and run any loop-bearing demo (e.g., ../../examples/high_rank_tensor_demo.t81) with ./build/t81 compile … and ./build/t81 run …; the terminal will print a (policy … (loop … (file …) (line …) (column …))) block that matches the diagnostics shipped by t81. Together, the doc plus this CLI trace show the deterministic path from source loop → Axion policy output.

Axion CLI Trace Example

As a concrete Axion syscall/loop metadata example, run the weights demo with diagnostics enabled:

./build/t81 compile ../../examples/weights_load_demo.t81 -o ../../examples/weights_load_demo.tisc
./build/t81 run ../../examples/weights_load_demo.tisc --weights-model model.t81w

The HanoiVM prints the loop metadata right before execution:

axion loop metadata: file=../../examples/weights_load_demo.t81 line=12 column=5 bound=infinite annotated=true
(policy (tier 1) (loop (id 0) (file ../../examples/weights_load_demo.t81) (line 12) (column 5) (annotated true) (depth 0) (bound infinite)))

Copy this (policy …) block into logs or release notes to prove the deterministic trace from the T81 source to Axion’s policy engine; the reported file:line:column matches the diagnostics t81 already prints when a semantic error occurs.

Read the Axion Trace Reference guide to replay the same sequence of AxionEvent.verdict.reason strings inside the CI logs and Axion policy runners.

4. What’s Next?

Future gallery additions could include:

Please file an issue or PR if you’d like to expand the gallery with new samples or tooling.