CS Paper Radar

What Field Enumeration Costs to Compile in C++26: Native Reflection, Structured-Binding Packs, Reflection Libraries and Hand-Written Serializers on GCC 16

Denys Kachalenko

cs.PL cs.SE ·submitted 2026-11-23 08:17 UTC · v1
code/dataunusual

Abstract

C++26 adds standard ways to enumerate a struct's fields, among them static reflection (P2996, with P3394 annotations) and structured-binding packs (P1061), alongside hand-written code, X-macros and libraries (Boost.PFR, reflect-cpp, Glaze) that now ship pre-C++26 and C++26 paths. We time each in a struct serializer with byte-identical output on GCC 16.2.0, at the front end and at -O2, in randomized interleaved rounds with code-level checks of every single-factor contrast. At the front end, inline native enumeration in the form used in several of P2996's own examples, an expansion statement over the std::span of define_static_array, costs about as much per struct of 16 scalar fields as Boost.PFR and 7.96x a P1061 pack, itself about as cheap as hand-written code. The same loop over a constant array costs 0.47x as much: about half of the span form's cost comes with the span. The ratio to P1061 shrinks on a heterogeneous type graph and at -O2. In a whole translation unit at the front end the library outweighs the mechanism: 200 structs take 0.59 s with inline native enumeration, 0.56 s with Boost.PFR and 3.86-4.13 s with the C++26 paths of reflect-cpp and Glaze, whose visitors also compute field names. Per type, each library's C++26 path is cheaper than its pre-C++26 path at 16 fields, but Glaze's gain reverses at 128 fields (pinned release v9.1.0); Boost.PFR's C++17 path grows almost quadratically with the number of types. Hand-written serializers sharing one overloaded name grow superlinearly with the number of types. The -freflection flag alone makes reflection-free code up to 1.264x costlier per type on GCC 16.2.0 and up to 2.578x on 16.1.0, so comparisons between mechanisms depend on the point release. Part of the span form's cost grows with the number of structs, which we trace to GCC registering block-scope statics in quadratic time (reported as GCC PR128928).

Comment
21 pages, 5 figures, 6 tables. Code, raw per-run data and analysis scripts: https://doi.org/10.5281/zenodo.24443567 (GitHub: https://github.com/DenysKachalenko/CPP26FieldEnumerationCompileCostArtifact)

Closest papers

Nearest neighbours by meaning across the whole index.

ExeBench-FHD: Addressing Fidelity Issues in Decompiler Evaluation

cs.SE cs.LGcs.PL ·2026-10-20 ·Akarsh Ashok, Dinil Mon Divakaran, Vivek Balachandran
similarity 0.56
Abstract

ExeBench is one of the most widely used benchmarks for evaluating LLM-based decompilers. We analyze ExeBench and identify nine issues that affect how faithfully a test measures a decompiler. Three of them prevent LLM decompilers from recovering C code from ExeBench's function. These are ambiguous parameter order when integer and floating-point types are mixed, unused parameters that optimized assembly may drop, and constants stored outside the function's assembly code. Six more affect test validity: non-void functions without a return, placeholder types, static or inline functions removed by the optimizer, functions named main, trivial bodies and truncated definitions. We present ExeBench-FHD, a backward-compatible revision of ExeBench that adds 16 new fields: call-site assembly, data sections, test wrappers, linked-binary disassembly and five warning flags. In ExeBench, 38.9% of functions have at least one of the five flags; dropping records with any of the four warning flags (all except unused_param, which marks functions that the new wrappers make evaluable) keeps 63.9% of the corpus. In an evaluation at -O2 on four architectures, the new fields raise GPT 6 Sol's re-execution rate by up to 26.5%, 19.1% and 21.0% on functions that read data sections, mix parameter types and have unused parameters, respectively.

0.18

StagQ: Constraint-Driven Multi-Precision Weight Quantization for LLMs

cs.LG cs.CL ·2026-10-05 ·Zhe Wei, Mengqi Guo, Yuan Yuan, Jiunn Bin Lim, Boyi Pan +1 more
similarity 0.55
Abstract · 17 pages, 4 figures, 8 tables

Serving a large language model (LLM) across a fleet of deployments requires several weight-precision operating points. Multi-precision formats serve them all from one stream whose prefixes are valid lower-precision codes, instead of storing multiple copies. We present StagQ, a multi-precision weight format whose main stream is a 2-bit group-wise affine base followed by a configurable number of 1-bit refinement planes on a dyadic step schedule. Every supported precision is a readable prefix, decoded by an affine map derived from metadata shared across all precisions, with no per-weight lookup. A sparse side record, filled both before and after the grid is fitted, holds out the few weights the grid serves worst. We report two configurations of the encoder. At two bits the cheaper one leads the strongest multi-precision baseline on Llama-3.1-8B, Phi-4, and OLMo-2-7B by 3.1 to 7.0 MMLU points, at a slightly lower logical rate. At three bits it leads on Llama-3.1-8B, leads on Phi-4 at a higher rate, and ties on OLMo-2-7B. At four bits it ties on all three, at a higher rate. In a batch-one matrix-vector product on an NVIDIA A100 GPU, timed on synthetic weights, our kernel is faster than the two baseline kernels in most shape-precision cases.

0.55

DeCompCert: A Verified Decompiler for CompCert-Generated AArch64

cs.PL cs.CR ·2026-11-13 ·Swarn Priya, Basavesh Ammanaghatta Shivakumar, Thomas Gilray, Kristopher Micinski
theory similarity 0.55
Abstract

DeCompCert is a Rocq-verified decompiler for AArch64 assembly generated by CompCert. It reconstructs CompCert C through nine reverse passes, combining deductively verified transformations with translation validation. Untrusted OCaml and Datalog analyses propose candidate reconstructions, while verified validators accept only candidates that satisfy the required semantic correspondence. The composed correctness theorem guarantees that every defined, safe behavior of an accepted C reconstruction is matched by the input CompCert assembly; under a safety assumption, the two programs are observationally equivalent. We evaluate DeCompCert on approximately 2.16 million lines of C. With exact function and call signatures, it reconstructs and recompiles all 3,173 eligible contexts under both unoptimized and optimized CompCert pipelines. Without retained signatures, its cumulative inference portfolio validates 2,606 of 3,164 contexts (82.4%), while the platform-plus-IDA configuration validates 2,407 contexts (76.1%). Native execution and output-quality experiments further evaluate the generated C and characterize the remaining limitations in signature recovery and source resemblance.

0.21

mold: A Massively Parallel Linker

cs.OS ·2026-08-24 ·Rui Ueyama
top venue similarity 0.55
Abstract · 15 pages, 3 figures, 10 tables. Accepted to ASPLOS 2027

Linking is a critical step in the software build process that combines compiled object files into a single executable or shared library. Despite decades of engineering effort, link times remain a significant bottleneck in the edit-compile-debug cycle, particularly for large C++ programs. Existing linkers exploit limited parallelism, leaving most CPU cores idle during linking. We present mold, a Unix/Linux linker that applies data parallelism systematically across the entire linking pipeline. We first analyze the architectural constraints that prevent existing linkers from scaling, including entangled symbol resolution and archive processing, and then show how a clean-slate design that decouples them overcomes these limitations. On large real-world programs, mold links multi-gigabyte debug binaries in at most a few seconds, and often in under a second. It is 2.4-16.1x faster than the state-of-the-art lld linker, and up to 112x faster than the traditional GNU ld. An ablation study shows that no single optimization dominates; the speedup comes from the cumulative effect of parallelizing all passes.

0.47

STILL: Recovering Lowered STL Semantics for LLM-assisted C++ Decompilation

cs.SE ·2026-08-26 ·Xiaohan Wang, Kevin Leach
top venue similarity 0.54
Abstract

LLM-assisted decompilation improves readability and re-executability, but still underperforms on stripped C++ functions that use the Standard Template Library (STL). Compilation, optimization, and symbol stripping remove or obscure source-level semantics such as container types and library-call structure, while traditional decompiler output often fails to recover them. We present STILL, a structured semantic interface that predicts function-level STL container semantics from stripped control-flow graphs and renders them as compact hints for LLM refinement. On StlBench, STILL predicts common container-level STL semantics, with the strongest cross-dataset results for stable string and vector slices. On stripped HumanEval decompilation, these hints enable DeepSeek-chat refinement to reach 28.4% executability, compared with 17.4% for no-hint refinement and 8.9% for raw Ghidra decompilation; hint utility is downstream-backbone-dependent, with decompilation-specialized models requiring lightweight adaptation to benefit from the same interface.

0.41

zkDuel: Characterizing SumCheck Prover Kernels across GPU Programming Models

cs.AR ·2026-10-26 ·Samarth Narang, Alhad Daftardar, Brandon Reagen
publishedbenchmark similarity 0.54
Abstract · Accepted to HASP'26 at MICRO 2026

SumCheck is a central prover primitive in zero-knowledge proofs, exposing table-parallel work that maps naturally to GPUs but becomes increasingly arithmetic-intensive as finite fields widen. We study how this shift affects the cost of programming SumCheck in Triton rather than CUDA. Our benchmark, zkDuel, provides matched implementations of 25 zkPHIRE-derived constraints alongside diagnostic polynomials, covering 32-, 64-, 128-, and 256-bit prime fields, with independent CPU-reference validation and cross-backend checksum gating. Of 800 configurations attempted on an NVIDIA H100, 758 complete with matching checksums. CUDA's median advantage over Triton falls from 3.5x at 32 bits to 1.4x at 256 bits, and Triton is faster on 19 large-table configurations; the same convergence appears on an A100, where the gap falls from 4.4x to 1.6x. Profiling shows that the small-field gap largely reflects host launch overhead and redundant modular additions in Triton's original block reduction, whose relative costs diminish as multi-limb Montgomery work grows. Replacing that reduction with tl.reduce brings Triton's median kernel time within 8% of CUDA on both GPUs, while specialized point interpolation improves 256-bit evaluation kernels by 1.55-1.75x. At cryptographic widths, these results show that a Python-embedded DSL can approach CUDA performance, although the largest fully unrolled constraints still expose compiler-scalability limits.

0.32

Native FPGA Hard-Block Implementation from High-Level Synthesis

cs.AR ·2026-11-18 ·Mohamed Bouaziz, Mahmoud A. Elshenawy, Krishnan B. Iyer, Abdurauf Abdurakhmanov, Ammar M. Seliaman +1 more
similarity 0.54
Abstract

High-level synthesis (HLS) maps computations to FPGA hard blocks, yet often leaves their arithmetic modes, internal registers, and cascade links idle and recreates them in the fabric, costing area and timing. We present a C++ template library that reaches native hard-block implementations without modifying the HLS compiler. Templates fix source patterns, and an automatic flow picks scheduling settings and verified RTL patches. On AMD Versal, our matrix multiplication uses 2.4--4.5x fewer lookup tables (LUTs) than AutoSA systolic arrays at equal or higher estimated throughput. Our INT8 matrix--vector units reach the three multiply--accumulates per DSP of hand-written FINN RTL, versus at most 1.29 for HLS libraries. In hls4ml, Allo, and Stream-HLS, the templates cut LUTs by up to 2.7x and DSPs by up to 2x.

0.33

FP64 Performance and the Limits of Ozaki Emulation on HPC Systems

cs.DC math.NA ·2026-11-09 ·Katarzyna, Swirydowicz, Nicholas Malaya, Noah Wolfe, Paul Bauman +2 more
similarity 0.54
Abstract · 11 pages, 7 figures

A growing industry narrative holds that native double precision can be deprioritized in HPC accelerators, on the hypothesis that low-precision tensor cores can emulate FP64 on demand, and that most HPC workloads are bandwidth-bound. This paper evaluates some of those claims and explores the importance of FP64 in scientific computing. We show roofline profiling data of representative HPC workloads, across a variety of common computational motifs, to evaluate the arithmetic-intensity and accuracy requirements of these workloads. We also consider FP64 emulation via the Ozaki method to ascertain some of the possibilities and limitations of these approaches. These results indicate that Ozaki emulation should not be evaluated as a general replacement for FP64, but as an optimization for the subset of workloads whose dominant computation is sufficiently large, dense, and GEMM-shaped. Our analysis indicates this is less than 10\% of the HPC ecosystem. Furthermore, even in this favorable regime, standalone GEMM speedup is not enough to accelerate (or avoid performance regression) for the application: numerical behavior, workspace requirements, matrix shape, and integration overhead determine whether the benefit survives at application scale. This paper characterizes those boundaries empirically. Furthermore, we show that dense GEMM accounts for only a small fraction of FP64 computation across HPC workloads, leaving most application-level FP64 work beyond the reach of GEMM-based emulation.

0.28