Lune

OOPSLA2024顶会

Finding Cross-Rule Optimization Bugs in Datalog Engines

Chi Zhang, Linzhang Wang, Manuel Rigger

摘要

Datalog is a popular and widely-used declarative logic programming language. Datalog engines apply many cross-rule optimizations; bugs in them can cause incorrect results. To detect such optimization bugs, we propose an automated testing approach called Incremental Rule Evaluation (IRE), which synergistically tackles the test oracle and test case generation problem. The core idea behind the test oracle is to compare the results of an optimized program and a program without cross-rule optimization; any difference indicates a bug in the Datalog engine. Our core insight is that, for an optimized, incrementally-generated Datalog program, we can evaluate all rules individually by constructing a reference program to disable the optimizations that are performed among multiple rules. Incrementally generating test cases not only allows us to apply the test oracle for every new rule generated—we also can ensure that every newly added rule generates a non-empty result with a given probability and eschew recomputing already-known facts. We implemented IRE as a tool named Deopt, and evaluated Deopt on four mature Datalog engines, namely Soufflé, CozoDB, μZ, and DDlog, and discovered a total of 30 bugs. Of these, 13 were logic bugs, while the remaining were crash and error bugs. Deopt can detect all bugs found by queryFuzz, a state-of-the-art approach. Out of the bugs identified by Deopt, queryFuzz might be unable to detect 5. Our incremental test case generation approach is efficient; for example, for test cases containing 60 rules, our incremental approach can produce 1.17× (for DDlog) to 31.02× (for Soufflé) as many valid test cases with non-empty results as the naive random method. We believe that the simplicity and the generality of the approach will lead to its wide adoption in practice.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Finding bugs in database systems via query partitioning 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Finding bugs in database systems via query partitioning 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Formulog: Datalog for SMT-based static analysis 引用了 Securify: Practical Security Analysis of Smart Contracts
  • Detecting optimization bugs in database engines via non-optimizing reference engine construction 引用了 Testing Database Engines via Pivoted Query Synthesis
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Interrogation Testing of CHC SolversDavid Kaindlstorfer, Anastasia Isychev, Valentin Wüstholz, Maria ChristakisFSE 2026 · 1 次引用
  2. One Size Does NOT Fit All: on the Importance of Physical Representations for Datalog EvaluationNick Johannes Peter Rassau, Felix SchuhknechtICDE 2026

它引用的 Paper11

  1. Securify: Practical Security Analysis of Smart ContractsPetar Tsankov, Andrei Marian Dan, Dana Drachsler-Cohen, Arthur Gervais 等CCS 2018 · 1,108 次引用
  2. Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 次引用
  3. Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 次引用
  4. Detecting optimization bugs in database engines via non-optimizing reference engine constructionManuel Rigger, Zhendong SuFSE 2020 · 104 次引用
  5. Formulog: Datalog for SMT-based static analysisAaron Bembenek, Michael Greenberg, Stephen ChongOOPSLA 2020 · 26 次引用

相关 Paper

  1. Metamorphic testing of Datalog enginesMuhammad Numair Mansur, Maria Christakis, Valentin WüstholzFSE 2021 · 25 次引用
  2. Dependency-Aware Metamorphic Testing of Datalog EnginesMuhammad Numair Mansur, Valentin Wüstholz, Maria ChristakisISSTA 2023 · 10 次引用
  3. Interactive Debugging of Datalog ProgramsAndré Pacak, Sebastian ErdwegOOPSLA 2023 · 4 次引用
  4. Automated Debugging of Datalog ProgramsJiashen Wei, Baoyuan Luo, Runshuo Xie, Yun Qi 等OOPSLA 2026
  5. Keep It Simple: Testing Databases via Differential Query PlansJinsheng Ba, Manuel RiggerSIGMOD 2024 · 23 次引用
黄昏的海面,两侧是细线勾勒的悬崖