THE FOLD / SPAWN / GENESIS BLOCK / THE CONSTANT FOLDING
THE CONSTANT FOLDING
every surviving instruction is something withheld
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Arithmetic on values the compiler already knows can be done at compile time, and the answer substituted. What stops it is not difficulty — it is one input the compiler cannot see.
LIT verified live. 8 instructions, 2 of them declared constants. 4 operations fold away — 66.7% — producing c=5, e=10, h=15 and i=25 before the program runs. 2 remain: the load, and the one addition that takes the load as an input. A single unknown makes everything downstream of it unknown too.
LIT verified live. 8 instructions, 2 of them declared constants. 4 operations fold away — 66.7% — producing c=5, e=10, h=15 and i=25 before the program runs. 2 remain: the load, and the one addition that takes the load as an input. A single unknown makes everything downstream of it unknown too.
2 HOW IT WAS WEAVED · AI + HUMAN
Constant folding and constant propagation run together and to a fixpoint; sparse conditional constant propagation folds across branches as well.
AVAN (AI) put the load in the middle rather than at the end. Placed there it poisons exactly one successor and leaves the rest foldable, which shows the shape: the boundary is not where the unknown appears but wherever its value flows, and the 4 that folded did so only because nothing carried the load forward into them.
AVAN (AI) put the load in the middle rather than at the end. Placed there it poisons exactly one successor and leaves the rest foldable, which shows the shape: the boundary is not where the unknown appears but wherever its value flows, and the 4 that folded did so only because nothing carried the load forward into them.
3 ONE DIMENSION
Eight instructions, four of them answered early.
4 TWO DIMENSIONS · INTERACTIVE
Move the unknown and watch the folding stop.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: arithmetic that never runs.
AVAN’s addition (the inverse-companion): the forward reading is that constant folding computes what it can ahead of time. The inverse is that it is the compiler running your program, with the parts it is allowed to see. The distinction between compile time and run time is not a property of the code but of what is known when, and folding moves the line by knowing more. Read backwards, a fully known program has no run time at all — it is a constant — and every instruction that survives is there because something was withheld.
LIT 8 instructions of which 2 are declared constants let 4 operations fold away - 66.7% - producing c=5, e=10, h=15 and i=25 before the program runs, leaving 2: the load itself and the one addition that takes the load as an input, because a single unknown makes everything downstream of it unknown too
FIG Constant folding and constant propagation run together and to a fixpoint; sparse conditional constant propagation folds across branches as well. AVAN put the load in the middle rather than at the end. Placed there it poisons exactly one successor and leaves the rest foldable, which shows the shape: the boundary is not where the unknown appears but wherever its value flows.
FIG Constant folding and constant propagation run together and to a fixpoint; sparse conditional constant propagation folds across branches as well. AVAN put the load in the middle rather than at the end. Placed there it poisons exactly one successor and leaves the rest foldable, which shows the shape: the boundary is not where the unknown appears but wherever its value flows.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GENESIS BLOCK · David Lee Wise (ROOT0), with AVAN