cobble · field dataflow

Algorithm explainers

The techniques cobble's field dataflow is built on, for engineers who have not met them before. Each page states a problem, walks a small COBOL program one statement at a time with the analysis state after each, and ends with the precise rule and where it goes wrong.

Read them in order; each page's "Read first" line names what it actually depends on.

  1. Visiting a graph: BFS, DFS and reverse postorder — the standard orders for walking a program's statements, and why reverse postorder hands every statement its input complete.
  2. Fixpoints and worklists — how an analysis handles loops: apply the rules until nothing changes, and why the visiting order matters for cost but not for the answer.
  3. Gen/kill and reaching definitions — for every read, which writes could have produced the value it sees, and why only a certain overwrite may discard one.
  4. Byte-extent aliasing — fields as byte ranges: how groups, REDEFINES and partial writes alias, and why overlapping is not the same as covering.
  5. Value sets and dynamic calls — resolving CALL WS-PGM statically by tracking the values a field can hold, and the reasons that set may be incomplete.

Making it finish on a large corpus — the techniques that took the dynamic-call-target pipeline from not finishing to finishing, continuing the numbering above:

  1. Area need — which bytes of a commarea, USING or RETRIEVE INTO area anyone actually reads, so the fixpoint tracks those and not the whole area.
  2. Resolving a dynamic call site inside its own program — reaching definitions of literals decide where a site can go, so its program is charged only those callees' needs instead of everyone's.
  3. Rounds across programs — area need settles in rounds, and each round after the first walks only the programs whose inputs changed.
  4. Sweeps — a fixpoint with a budget of reverse-postorder sweeps, and a mark on every result that did not settle within it.
  5. Answering every walk once — strongly connected components and a memo, so thousands of walks over the same places cost one walk; plus place identity and an edge index.
  6. Bounding walks by crossings — a limit on program crossings per walk that marks every result it cut, and how to pick the limit.

Background — the COBOL and CICS vocabulary, and one graph technique several pages lean on:

Related — not part of cobble's own build-up, each pulled from wherever it actually came from: