Skip to content

Add OSS-Fuzz integration for openxla/xla#15464

Open
ricaskew wants to merge 1 commit into
google:masterfrom
ricaskew:add-xla-oss-fuzz-project
Open

Add OSS-Fuzz integration for openxla/xla#15464
ricaskew wants to merge 1 commit into
google:masterfrom
ricaskew:add-xla-oss-fuzz-project

Conversation

@ricaskew
Copy link
Copy Markdown

@ricaskew ricaskew commented May 5, 2026

Add OSS-Fuzz integration for openxla/xla

This PR registers openxla/xla with OSS-Fuzz, adding continuous fuzzing
coverage for XLA's HLO text-format parser and proto deserialization path.
This is the first OSS-Fuzz integration for openxla/xla.

Companion PR in openxla/xla adding the harness sources:
openxla/xla#42055

Note: this integration depends on the companion PR above. The build.sh
guard will exit non-zero until openxla/xla#42055 merges and
xla/fuzz/BUILD is present in the upstream tree. Exact error message:
ERROR: xla/fuzz/BUILD missing — PR-A (upstream harness landing) must merge before this OSS-Fuzz integration builds cleanly.
The OSS-Fuzz CI build will serve as the first end-to-end validation
in the clean pipeline environment.

Project details

homepage: https://openxla.org/xla
language: C++
sanitizers: address
fuzzing_engines: libfuzzer
primary_contact: xla-team@google.com

Harnesses

hlo_parser_fuzz — exercises xla::ParseAndReturnUnverifiedModule
against arbitrary text input bytes. Targets the HLO text-format parser
surface.

hlo_proto_fuzz — exercises xla::HloModule::CreateFromProto against
arbitrary byte sequences. Includes an explicit size guard against integer
overflow on the ParseFromArray size argument.

Build notes

XLA uses a hermetic LLVM18 toolchain that dynamic-links libc++. The
base-runner image does not ship libc++, so build.sh resolves this by
embedding --linkopt=-Wl,-rpath,$ORIGIN and staging the required libc++
shared objects alongside the fuzzer binaries in $OUT/.

The Dockerfile uses base-builder:ubuntu-24-04 and installs OpenJDK 17
via install_java.sh (matching the pattern used by other Google ML
projects in OSS-Fuzz). Bazel is installed via Bazelisk v1.20.0, which
respects XLA's pinned .bazelversion file.

Testing

Both harnesses were smoke-tested inside the OSS-Fuzz Docker base image:

  • hlo_parser_fuzz: 100 runs, zero crashes, 2,371 coverage PCs with
    growth into xla::HloLexer and related parser code paths
  • hlo_proto_fuzz: 100 runs, zero crashes, 819 coverage PCs with
    growth into xla::HloModuleConfig and protobuf TcParser family

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

ricaskew is integrating a new project:
- Main repo: https://github.com/openxla/xla
- Criticality score: 0.64815

@ricaskew
Copy link
Copy Markdown
Author

ricaskew commented May 5, 2026

Companion harness PR in openxla/xla: openxla/xla#42055

Copy link
Copy Markdown
Collaborator

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waiting for openxla/xla#42055 to be resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants