How Does Libaom Manage Code Reviews and PRs?
The libaom development team manages code reviews and contributions through a structured, highly regulated workflow centered around the Gerrit Code Review system rather than traditional GitHub pull requests. As the reference software repository for the AV1 video codec, libaom enforces rigorous testing, peer validation, and automated continuous integration (CI) to ensure that every optimization and bug fix maintains strict codec compliance and performance standards. This article explores how developers submit code, how the peer review process is conducted, and how automated tools validate changes before they are merged into the main codebase.
The Gerrit Workflow vs. GitHub Pull Requests
While libaom has a mirror on GitHub, the project does not use GitHub Pull Requests for code management. Instead, the Alliance for Open Media (AOMedia) relies on Gerrit, a web-based code review tool built on top of Git.
- Change-Ids: Instead of tracking entire branches,
Gerrit tracks individual commits. Each commit is assigned a unique
Change-Id. When a developer updates their code based on review feedback, they amend their existing commit rather than pushing new ones, keeping the history clean. - The AOMedia Review Platform: Developers push their local Git branches directly to the official AOMedia Gerrit instance, which automatically generates a review thread for that specific change.
The Peer Review and Approval Process
Once a patch is submitted to Gerrit, it undergoes a meticulous review process by core maintainers and community contributors. For a patch to be merged, it must satisfy specific scoring criteria:
- Code Review Score: Reviewers evaluate the code for readability, optimization, and architectural fit. They assign a score ranging from -2 (Do not merge) to +2 (Approved). A patch generally requires at least one +2 from a core maintainer to proceed.
- Verified Score: This score is predominantly handled by automated systems. A patch must receive a +1 verification score, meaning it compiles successfully and passes all foundational unit tests.
Automated Testing and Continuous Integration (CI)
Because libaom is an incredibly complex codec where a minor change can drastically impact encoding speed or visual quality, automated testing is heavily integrated into the code review pipeline.
When a change is uploaded, automated CI bots trigger extensive test suites across multiple operating systems (Windows, macOS, Linux) and hardware architectures (x86, ARM). These tests check for:
- Regression: Ensuring encoding efficiency (BD-rate) does not unintentionally drop.
- Technical Compliance: Verifying that the bitstream generated by the modified encoder remains fully compliant with the AV1 specification.
- Sanitizers: Running AddressSanitizer (ASan) and UndefinedBehaviorSanitizer (UBSan) to catch memory leaks or unsafe code execution before deployment.
Merging the Code
Once the patch achieves the necessary peer approval (+2 Code Review)
and passes all automated CI requirements (+1 Verified), a project
maintainer submits the change. Gerrit then automatically merges the
commit into the master branch. Because of Gerrit’s linear history model,
the project maintains a clean, straightforward commit history, making it
easier to track down regressions or bugs using tools like
git bisect.