Searcharxiv⌕ Search

arXiv subjects

Ernest Ng

Publications and source records attributed to Ernest Ng.

5 recordsLinked to original sources

Underpinning Property-Based Testing

As the property-based testing community strives to automate challenging parts of the process away from users --- in particular, the construction of generators --- it is critical that we can clearly state what it means for that automation to be correct. We present a new framework for PBT, implemented in the Lean theorem prover, that provides a more solid foundation to build on. Our generators are interpretable: interpreted one way, they can be run efficiently as programs that sample randomness; and interpreted another way, they enable a wide range of correctness proofs, including proofs about distributions that other foundational PBT models do not support. We evaluate our framework extensively, with both small and large benchmarks and case studies, arguing that the extra power brought by distributional proofs is practically important for the next generation of generator automation.

cs.PL↗

Compiling Imperative Hardware Protocol Specifications to Hardware

Correct modular composition in hardware depends on interfaces with subtle multi-cycle timing behavior, yet such protocols remain difficult to specify, test, and debug. Recent work has demonstrated that hardware communication specifications can take the form of compact imperative programs that describe the cycle-by-cycle behavior of each logical transaction. However, prior tools only use these specifications for simulation-based testing and debugging, and their semantics remain informal. In this work, we develop a theory of hardware protocol specifications using automata. In addition to making the specifications' meaning precise, the automaton representation lets us compile them into synthesizable hardware. We implement a compiler that produces RTL modules for driving hardware interfaces and for reconstructing logical transactions from low-level I/O signals. We demonstrate a variety of use cases for synthesizable protocol drivers and reconstructors, including runtime monitors that check security properties in the Wishbone protocol and a binding generator that synthesizes interfaces between RTL modules and programs in the Calyx intermediate language.

cs.PL↗

Specifying Hardware Communication as Programs

To test and debug hardware modules, it is common to write two programs. A driver maps high-level transactions to cycle-level I/O behavior, and a monitor looks at the low-level I/O trace and recovers transactions. Both programs bridge the same abstraction gap between RTL and functional models. Writing them separately risks inconsistency. ProtoLang is a DSL for specifying hardware protocols. The same ProtoLang program can both drive and monitor transactions. Users specify RTL communication protocols as succinct imperative programs. We present a novel reconstructor algorithm that, given a ProtoLang specification and a waveform, automatically infers a transaction-level trace consistent with the waveform. We demonstrate ProtoLang's utility via case studies focusing on the Wishbone and AXI-Stream interconnects, showing that ProtoLang can model complex protocol features such as burst mode. We highlight how our tools can identify protocol violation bugs in real-world implementations.

cs.PL↗

Mica: Automated Differential Testing for OCaml Modules

Suppose we are given two OCaml modules implementing the same signature. How do we check that they are observationally equivalent -- that is, that they behave the same on all inputs? One established technique is to use a property-based testing (PBT) tool such as QuickCheck. Currently, however, this can require significant amounts of boilerplate code and ad-hoc test harnesses. To address this issue, we present Mica, an automated tool for testing observational equivalence of OCaml modules. Mica is implemented as a PPX compiler extension, allowing users to supply minimal annotations to a module signature. These annotations guide Mica to automatically derive specialized PBT code that checks observational equivalence. We discuss the design of Mica and demonstrate its efficacy as a testing tool on various modules taken from real-world OCaml libraries.

cs.PL↗

Self-Evolving Adaptive Learning for Personalized Education

Primary and secondary education is a crucial stage to build a strong foundation before diving deep into specialised subjects in colleges and universities. To excel in the current education system, students are required to have a deep understanding of knowledge according to standardized curriculums and syllabus, and exam-related problem solving skills. In current school settings, this learning normally occurs in large classes of 30-40 students per class. Such a ``one size fits all'' approach may not be effective, as different students proceed on their learning in different ways and pace. To address this problem, we propose the Self-Evolving Adaptive Learning (SEAL) system for personalized education at scale.

physics.ed-ph↗