VEIL: Reading Control Flow Graphs Like Code CCS: Human-centered computing Graph drawings CCS: Human-centered computing Information visualization

Philipp Schaad, Tal Ben-Nun, Torsten Hoefler · 2025

Read VEIL: Reading Control Flow Graphs Like Code CCS: Human-centered computing Graph drawings CCS: Human-centered computing Information visualization by Philipp Schaad, Tal Ben-Nun, Torsten Hoefler (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-05066.txt.

Introduction

Philipp Schaad, Tal Ben-Nun, and Torsten Hoefler present VEIL, a layout method that makes control flow graphs read like code. Such graphs map how a program jumps between blocks, but real graphs have thousands of nodes and tangled edges.

Common graph drawing tools often place later steps before earlier ones, which hides how a program runs. VEIL sets rules made just for these graphs, with flow order kept intact. It uses dominator analysis, which finds blocks that all paths must cross, to build clearer layouts that the authors test against past tools.

Catalog record

CREATORPhilipp Schaad, Tal Ben-Nun, Torsten Hoefler
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE58 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2511-05066

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

VEIL: Reading Control Flow Graphs Like Code CCS: Human-centered computing Graph drawings CCS: Human-centered computing Information visualization Philipp Schaad, Tal Ben-Nun, Torsten Hoefler Abstract . Control flow graphs (CFGs) are essential tools for understanding program behavior, yet the size of real-world CFGs makes them difficult to interpret. With thousands of nodes and edges, sophisticated graph drawing algorithms are required to present them on screens in ways that make them readable and understandable. However, being designed for general graphs, these algorithms frequently break the natural flow of execution, placing later instructions before earlier ones and obscuring critical program structures. In this paper, we introduce a set of criteria specifically tailored for CFG visualization, focusing on preserving execution order and making complex structures easier to follow. Building on these criteria, we present VEIL, a new layout algorithm that uses dominator analysis to produce clearer, more intuitive CFG layouts. Through a study of CFGs from real-world applications, we show how our method improves readability and provides improved layout performance compared to state of the art graph drawing techniques. The left side of the figure contains the control flow graph of a 2-D electromagnetic wave propagation, as drawn by Graphviz. In that drawing, the program exit node is placed close to (2 layers below) the program start, and various nodes contain two or more outgoing edges, which appears to form conditional branching in the code. Additionally, most loops are drawn in a way in which their exit / what is executed after the loop is drawn on the same height as or above the loop. This makes detecting loop nest depth difficult. The right side of the figure contains the same CFG laid out with VEIL. In this drawing, all nodes appear in a straight line from top to bottom, indicating that there is no conditional branching. The program exit lies at the very bottom of the graph, respecting happens-before relationships. Finally, back edges and forward edges are grouped together, respectively, more clearly indicating loop nest depths. Figure 1 . The control flow graph of a program computing 2-D electromagnetic wave propagation, drawn using Graphviz with the dot layout algorithm (left) and our new layout algorithm, VEIL (right), which optimizes layouts for control flow graphs. The left side of the figure contains the control flow graph of a 2-D electromagnetic wave propagation, as drawn by Graphviz. In that drawing, the program exit node is placed close to (2 layers below) the program start, and various nodes contain two or more outgoing edges, which appears to form conditional branching in the code. Additionally, most loops are drawn in a way in which their exit / what is executed after the loop is drawn on the same height as or above the loop. This makes detecting loop nest depth difficult. The right side of the figure contains the same CFG laid out with VEIL. In this drawing, all nodes appear in a straight line from top to bottom, indicating that there is no conditional branching. The program exit lies at the very bottom of the graph, respecting happens-before relationships. Finally, back edges and forward edges are grouped together, respectively, more clearly indicating loop nest depths. † † cc-license: by-sa 1. Introduction Control flow graphs (CFGs) are directed graphs that represent the order of execution in a program. Visual analysis and understanding of CFGs are central to many tasks in computer systems, including debugging ( 18 ; 21 ) , performance tuning ( 29 ; 13 ; 47 ) , compiler development ( 17 ; 69 ) , reverse engineering ( 56 ; 43 ) , and security analysis ( 1 ; 2 ) , to name a few. In many of these contexts, CFGs are not just a convenient but necessary tool. For instance, when source code is unavailable during binary analysis, or when compiler optimizations alter original control structures such as through simplification or reordering. However, the CFGs of real-world applications are often very large, containing thousands of nodes and edges. This scale makes visual comprehension difficult, especially in the presence of complex control flow constructs such as loops with multiple exit paths, extensive branching, or goto statements. To support understanding and analysis, numerous graph drawing algorithms have been developed to map graphs to the 2-D plane. Considerable research has focused on defining graph layout criteria to maximize readability, often validated through comprehensive user studies ( 55 ; 53 ; 60 ; 68 ; 9 ) . This has led to the development of specialized graph drawing algorithms for specific classes of graphs, as well as some general-purpose algorithms that have become widely adopted in tools such as Graphviz ( 27 ; 33 ; 32 ) . While general-purpose algorithms perform well across many domains, they often struggle with complex CFGs. Their adherence to broad layout criteria can introduce artifacts that reduce readability. For example, nodes that appear later in the execution order may be placed closer to the start of the program than nodes appearing earlier in execution order, disrupting the natural flow of analysis (see Fig. 1 ). Such artifacts suggest that state-of-the-art layout criteria are insufficient for the domain of CFGs and program flow analysis. In this paper, we codify the criteria a graph drawing algorithm geared towards control flow graphs should follow. We identify interaction and visualization techniques that benefit from the outlined criteria. These criteria and techniques aim to help humans interact with CFGs in a more natural manner, more comparable to interactions with program source code rather than typical graph representations. We develop a novel graph drawing algorithm called VEIL, the Vertical Execution-order Informed Layout, that optimizes CFG drawings with respect to the identified criteria. By employing graph dominator analysis, our algorithm not only achieves intuitive graph layouts, but offers improved layout times compared to graph drawing algorithms frequently used for CFGs. Using a series of CFGs from real-world applications, we perform an in-depth evaluation of our graph drawing algorithm and compare it to state-of-the-art techniques. We evaluate and compare how well different techniques adhere to the identified layout criteria, and discuss how this impacts readability and comprehension. In summary, this paper makes the following contributions: • A codified set of aesthetics criteria for evaluating CFG-specific graph layouts. • VEIL, a novel layout algorithm that optimizes for CFG-specific aesthetics and structural criteria. • An in-depth comparison of VEIL with state-of-the-art algorithms across real-world CFGs. 2. Aesthetics of Control Flow Graph Drawings Over the years, numerous studies have proposed concrete aesthetic criteria that graph drawing algorithms should follow to maximize readability and comprehension ( 6 ; 62 ; 55 ; 53 ; 61 ) . Many of these criteria have been repeatedly validated in empirical user studies ( 8 ; 53 ; 41 ; 39 ; 54 ; 66 ) and have become de facto standards for graph visualization. By extension, algorithms for drawing control flow graphs (CFGs) should also adhere to these principles. The nine most consistently supported criteria, i.e., those that appear frequently across studies and are rated as important for comprehension, are as follows: The figure shows an excerpt of the control flow graph for the same program as in Fig. 1, drawn as created by Compiler

Read the complete text