feat: add float/double comparison tracking to instrumentor#1045
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds float/double comparison tracing to Jazzer’s data-flow instrumentation so value profiling can learn from floating-point compares (including NaN and signed-zero edge cases).
Changes:
- Extend the bytecode instrumentor to wrap
DCMP*/FCMP*instructions and report raw float/double bits via existing cmp tracing. - Add runtime callback wrappers for float/double compare semantics (NaN handling, signed zero) and extend generic comparison tracing to include
Float/Double. - Add/update tests (instrumentation golden expectations, runtime semantics tests, and a new fuzz target) plus update docs to reflect new
cmpcoverage.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/src/test/java/com/example/FloatDoubleCmpFuzzer.java | New fuzz target validating float/double compare tracking under value profiling. |
| tests/BUILD.bazel | Registers the new fuzz target test with value profile enabled. |
| src/test/java/com/code_intelligence/jazzer/runtime/TraceCmpHooksTest.java | Adds unit tests asserting wrapper semantics for float/double compares. |
| src/test/java/com/code_intelligence/jazzer/instrumentor/TraceDataFlowInstrumentationTest.kt | Updates expected callback traces to include float/double comparisons (incl. NaN/signed zero). |
| src/test/java/com/code_intelligence/jazzer/instrumentor/TraceDataFlowInstrumentationTarget.java | Adds float/double comparison cases to exercise new instrumentation paths. |
| src/test/java/com/code_intelligence/jazzer/instrumentor/MockTraceDataFlowCallbacks.java | Adds mock wrappers for float/double compare instrumentation used by tests. |
| src/main/java/com/code_intelligence/jazzer/runtime/TraceDataFlowNativeCallbacks.java | Implements float/double wrapper callbacks and extends generic comparison tracing. |
| src/main/java/com/code_intelligence/jazzer/runtime/TraceCmpHooks.java | Adds hooks for Float/Double compare/compareTo to trace operand bits. |
| src/main/java/com/code_intelligence/jazzer/instrumentor/TraceDataFlowInstrumentor.kt | Instruments DCMP*/FCMP* and refines IF* skip logic for wrapped compares. |
| docs/advanced.md | Documents cmp tracing support for float/double. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/code_intelligence/jazzer/instrumentor/TraceDataFlowInstrumentor.kt
Outdated
Show resolved
Hide resolved
bc07a12 to
5a24cb0
Compare
5a24cb0 to
703cba3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for tracing double and float compare instructions