Workflow and Source Panels
Work Queue Panel
Model queued Lua work as deterministic scalar steps.
work queue
A queue can be replayed without timers when each work item is represented by fixed scalar data.
Work Queue Panel
work_queue_panel.lua
Replay: real traced execution (multi-file project)
local extra = "audit"
local log = ""
local total = 0
for index, name in ipairs({"read", extra, "write"}) do
local cost = index
local label = "run:" .. name
total = total + cost
if log == "" then
log = label
else
log = log .. "," .. label
end
end
print("extra=" .. extra)
print("log=" .. log)
print("total=" .. total)
local extra = "read"
local log = ""
local total = 0
for index, name in ipairs({"read", extra, "write"}) do
local cost = index
local label = "run:" .. name
total = total + cost
if log == "" then
log = label
else
log = log .. "," .. label
end
end
print("extra=" .. extra)
print("log=" .. log)
print("total=" .. total)
local extra = "render"
local log = ""
local total = 0
for index, name in ipairs({"read", extra, "write"}) do
local cost = index
local label = "run:" .. name
total = total + cost
if log == "" then
log = label
else
log = log .. "," .. label
end
end
print("extra=" .. extra)
print("log=" .. log)
print("total=" .. total)
extra ← audit, log ← (empty), total ← 0
1local extra→ audit = "audit" --@extra="read", "render"2local log→ (empty) = ""3local total→ 0 = 0cost ← 1, label ← run:read, total ← 1
pass 1 of 35for index1, nameread in ipairs({"read", extraaudit, "write"}) do6 local cost→ 1 = index17 local label→ run:read = "run:" .. nameread8 total→ 1 = total + cost19 if log == "" thenAll 3 passes — pass 1 is the card above pass indexnamecostlabeltotallog1 1 read 1 run:read 0 → 1 (empty) → run:read 2 2 audit 2 run:audit 1 → 3 run:read → run:read,run:audit 3 3 write 3 run:write 3 → 6 run:read,run:audit → run:read,run:audit,run:write log ← run:read
8total = total + cost9if log(empty) == "" then10 log→ run:read = labelrun:read11elselog ← run:read,run:audit
pass 1 of 210 log = label11else12 log→ run:read,run:audit = log .. "," .. labelrun:audit13endlog ← run:read,run:audit,run:write
pass 2 of 210 log = label11else12 log→ run:read,run:audit,run:write = log .. "," .. labelrun:write13endprint("extra=" .. extra)
16print("extra=" .. extraaudit)17print("log=" .. logrun:read,run:audit,run:write)18print("total=" .. total6)outputextra=audit log=run:read,run:audit,run:write total=6
extra ← read, log ← (empty), total ← 0
1local extra→ read = "read"2local log→ (empty) = ""3local total→ 0 = 0cost ← 1, label ← run:read, total ← 1
pass 1 of 35for index1, nameread in ipairs({"read", extraread, "write"}) do6 local cost→ 1 = index17 local label→ run:read = "run:" .. nameread8 total→ 1 = total + cost19 if log == "" thenAll 3 passes — pass 1 is the card above pass indexnamecostlabeltotallog1 1 read 1 run:read 0 → 1 (empty) → run:read 2 2 read 2 run:read 1 → 3 run:read → run:read,run:read 3 3 write 3 run:write 3 → 6 run:read,run:read → run:read,run:read,run:write log ← run:read
8total = total + cost9if log(empty) == "" then10 log→ run:read = labelrun:read11elselog ← run:read,run:read
pass 1 of 210 log = label11else12 log→ run:read,run:read = log .. "," .. labelrun:read13endlog ← run:read,run:read,run:write
pass 2 of 210 log = label11else12 log→ run:read,run:read,run:write = log .. "," .. labelrun:write13endprint("extra=" .. extra)
16print("extra=" .. extraread)17print("log=" .. logrun:read,run:read,run:write)18print("total=" .. total6)outputextra=read log=run:read,run:read,run:write total=6
extra ← render, log ← (empty), total ← 0
1local extra→ render = "render"2local log→ (empty) = ""3local total→ 0 = 0cost ← 1, label ← run:read, total ← 1
pass 1 of 35for index1, nameread in ipairs({"read", extrarender, "write"}) do6 local cost→ 1 = index17 local label→ run:read = "run:" .. nameread8 total→ 1 = total + cost19 if log == "" thenAll 3 passes — pass 1 is the card above pass indexnamecostlabeltotallog1 1 read 1 run:read 0 → 1 (empty) → run:read 2 2 render 2 run:render 1 → 3 run:read → run:read,run:render 3 3 write 3 run:write 3 → 6 run:read,run:render → run:read,run:render,run:write log ← run:read
8total = total + cost9if log(empty) == "" then10 log→ run:read = labelrun:read11elselog ← run:read,run:render
pass 1 of 210 log = label11else12 log→ run:read,run:render = log .. "," .. labelrun:render13endlog ← run:read,run:render,run:write
pass 2 of 210 log = label11else12 log→ run:read,run:render,run:write = log .. "," .. labelrun:write13endprint("extra=" .. extra)
16print("extra=" .. extrarender)17print("log=" .. logrun:read,run:render,run:write)18print("total=" .. total6)outputextra=render log=run:read,run:render,run:write total=6