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

extra
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)
  1. extra ← audit, log ← (empty), total ← 0

    1local extra→ audit = "audit" --@extra="read", "render"2local log→ (empty) = ""3local total→ 0 = 0
  2. cost ← 1, label ← run:read, total ← 1

    pass 1 of 3
    5for index1, nameread in ipairs({"read", extraaudit, "write"}) do6  local cost→ 1 = index17  local label→ run:read = "run:" .. nameread8  total→ 1 = total + cost19  if log == "" then
    All 3 passes — pass 1 is the card above
    passindexnamecostlabeltotallog
    11read1run:read0 1(empty) run:read
    22audit2run:audit1 3run:read run:read,run:audit
    33write3run:write3 6run:read,run:audit run:read,run:audit,run:write
  3. log ← run:read

    8total = total + cost9if log(empty) == "" then10  log→ run:read = labelrun:read11else
  4. log ← run:read,run:audit

    pass 1 of 2
    10  log = label11else12  log→ run:read,run:audit = log .. "," .. labelrun:audit13end
  5. log ← run:read,run:audit,run:write

    pass 2 of 2
    10  log = label11else12  log→ run:read,run:audit,run:write = log .. "," .. labelrun:write13end
  6. print("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
  1. extra ← read, log ← (empty), total ← 0

    1local extra→ read = "read"2local log→ (empty) = ""3local total→ 0 = 0
  2. cost ← 1, label ← run:read, total ← 1

    pass 1 of 3
    5for index1, nameread in ipairs({"read", extraread, "write"}) do6  local cost→ 1 = index17  local label→ run:read = "run:" .. nameread8  total→ 1 = total + cost19  if log == "" then
    All 3 passes — pass 1 is the card above
    passindexnamecostlabeltotallog
    11read1run:read0 1(empty) run:read
    22read2run:read1 3run:read run:read,run:read
    33write3run:write3 6run:read,run:read run:read,run:read,run:write
  3. log ← run:read

    8total = total + cost9if log(empty) == "" then10  log→ run:read = labelrun:read11else
  4. log ← run:read,run:read

    pass 1 of 2
    10  log = label11else12  log→ run:read,run:read = log .. "," .. labelrun:read13end
  5. log ← run:read,run:read,run:write

    pass 2 of 2
    10  log = label11else12  log→ run:read,run:read,run:write = log .. "," .. labelrun:write13end
  6. print("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
  1. extra ← render, log ← (empty), total ← 0

    1local extra→ render = "render"2local log→ (empty) = ""3local total→ 0 = 0
  2. cost ← 1, label ← run:read, total ← 1

    pass 1 of 3
    5for index1, nameread in ipairs({"read", extrarender, "write"}) do6  local cost→ 1 = index17  local label→ run:read = "run:" .. nameread8  total→ 1 = total + cost19  if log == "" then
    All 3 passes — pass 1 is the card above
    passindexnamecostlabeltotallog
    11read1run:read0 1(empty) run:read
    22render2run:render1 3run:read run:read,run:render
    33write3run:write3 6run:read,run:render run:read,run:render,run:write
  3. log ← run:read

    8total = total + cost9if log(empty) == "" then10  log→ run:read = labelrun:read11else
  4. log ← run:read,run:render

    pass 1 of 2
    10  log = label11else12  log→ run:read,run:render = log .. "," .. labelrun:render13end
  5. log ← run:read,run:render,run:write

    pass 2 of 2
    10  log = label11else12  log→ run:read,run:render,run:write = log .. "," .. labelrun:write13end
  6. print("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