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. Resolving a dynamic call site inside its own program — the value sets of a program's own literals settle most dynamic sites on the spot; only a name from outside, such as a caller's commarea, needs the cross-program walk.
  2. Sweeps — a fixpoint with a budget of reverse-postorder sweeps, and a mark on every result that did not settle within it.
  3. 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.
  4. Bounding walks by crossings — a limit on program crossings per walk that marks every result it cut, and how to pick the limit.

Finding domain aggregates — from byte provenance to groups of fields that make up one concept, continuing the numbering:

  1. From byte provenance to a field graph — byte moves become edges between elementary fields, copies through undivided buffers are traced back to the fields that filled them, and files link writers to readers through record slots.
  2. Exact field classes across programs — two programs' fields are one datum when every byte of one lands in place on the other, relayed through table occurrences and file slots; and what each loosening of that rule costs.
  3. Domain aggregates by matrix factorisation — a paragraph × field matrix, why non-negative factorisation suits it, rounds of decreasing threshold, and why the residual stays sparse.
  4. Scoring a factorisation — held-out AUC as the headline and seven sub-scores for fidelity, coverage, stability, distinctness, focus, reach and class share.

Calls inside a program and questions over the results, continuing the numbering:

  1. Summarising a PERFORM — each PERFORM walks its paragraph on only the bytes it can touch, keeps the result per entry state, and returns it to its own caller alone, so callers stop leaking into each other and a call that brings nothing new costs no walk.
  2. Answers with proofs — an English question becomes Datalog rules over the analysis's facts, under a checker that holds the rules to the question's words; every answer row comes with a derivation, and what that derivation does and does not prove.

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: