Workflow and Source Panels
Task Result Slots
Store independent task results in scalar slots before summarizing them.
task slots
Separate result slots make replay easier to follow because each task updates its own scalar state.
Task Result Slots
task_result_slots.lua
Replay: real traced execution (multi-file project)
local function read_slot(value)
return value + 10
end
local function write_slot(value)
return value * 3
end
local seed = 5
local read_value = 0
local write_value = 0
read_value = read_slot(seed)
write_value = write_slot(seed)
local total = read_value + write_value
print("read=" .. read_value)
print("write=" .. write_value)
print("total=" .. total)
local function read_slot(value)
return value + 10
end
local function write_slot(value)
return value * 3
end
local seed = 2
local read_value = 0
local write_value = 0
read_value = read_slot(seed)
write_value = write_slot(seed)
local total = read_value + write_value
print("read=" .. read_value)
print("write=" .. write_value)
print("total=" .. total)
local function read_slot(value)
return value + 10
end
local function write_slot(value)
return value * 3
end
local seed = 8
local read_value = 0
local write_value = 0
read_value = read_slot(seed)
write_value = write_slot(seed)
local total = read_value + write_value
print("read=" .. read_value)
print("write=" .. write_value)
print("total=" .. total)
seed ← 5, read_value ← 0, write_value ← 0
9local seed→ 5 = 5 --@seed=2, 810local read_value→ 0 = 011local write_value→ 0 = 01213read_value = read_slot(seed5)14write_value = write_slot(seed)read_value ← 15
13read_value→ 15 = read_slot(seed5)14write_value = write_slot(seed5)15local total = read_value + write_valuewrite_value ← 15, total ← 30
13read_value = read_slot(seed)14write_value→ 15 = write_slot(seed5)15local total→ 30 = read_value15 + write_value151617print("read=" .. read_value15)18print("write=" .. write_value15)19print("total=" .. total30)outputread=15 write=15 total=30
seed ← 2, read_value ← 0, write_value ← 0
9local seed→ 2 = 210local read_value→ 0 = 011local write_value→ 0 = 01213read_value = read_slot(seed2)14write_value = write_slot(seed)read_value ← 12
13read_value→ 12 = read_slot(seed2)14write_value = write_slot(seed2)15local total = read_value + write_valuewrite_value ← 6, total ← 18
13read_value = read_slot(seed)14write_value→ 6 = write_slot(seed2)15local total→ 18 = read_value12 + write_value61617print("read=" .. read_value12)18print("write=" .. write_value6)19print("total=" .. total18)outputread=12 write=6 total=18
seed ← 8, read_value ← 0, write_value ← 0
9local seed→ 8 = 810local read_value→ 0 = 011local write_value→ 0 = 01213read_value = read_slot(seed8)14write_value = write_slot(seed)read_value ← 18
13read_value→ 18 = read_slot(seed8)14write_value = write_slot(seed8)15local total = read_value + write_valuewrite_value ← 24, total ← 42
13read_value = read_slot(seed)14write_value→ 24 = write_slot(seed8)15local total→ 42 = read_value18 + write_value241617print("read=" .. read_value18)18print("write=" .. write_value24)19print("total=" .. total42)outputread=18 write=24 total=42