solana-labs / rbpf

Rust virtual machine and JIT compiler for eBPF programs
Apache License 2.0
277 stars 169 forks source link

Exercise all bpf instructions #552

Closed seanyoung closed 6 months ago

seanyoung commented 8 months ago

This tests checks that all the alu instructions have the same output for jit and interpreted.

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (179a0f9) 88.34% compared to head (b1fdeb9) 89.43%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #552 +/- ## ========================================== + Coverage 88.34% 89.43% +1.08% ========================================== Files 24 23 -1 Lines 10282 9931 -351 ========================================== - Hits 9084 8882 -202 + Misses 1198 1049 -149 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Lichtso commented 8 months ago

Looks good in general. However, we already have a bunch of fuzzers all with different interfaces, capabilities, etc. Would be nice to have a more structured approach instead of many individual ad-hoc solutions.

seanyoung commented 8 months ago

Looks good in general. However, we already have a bunch of fuzzers all with different interfaces, capabilities, etc. Would be nice to have a more structured approach instead of many individual ad-hoc solutions.

What do you have in mind?

I can extend this test to include branch tests and load/store tests, which would cover almost all of the instructions. I also feel this would be a useful addition for any future arm64 jitter.

LucasSte commented 8 months ago

Is there any updates on the status of this PR? I was looking forward to using this fuzzer.

LucasSte commented 8 months ago

I believe the PR is really good to ensure the consistency between the jitter and the interpreter and I thought it would be nice to even cover the SBFv1 instructions. There are instructions that the compiler does not emit today, but that the RPBF crate supports, so having this test ensures everything works in tandem if we were to enable their emission.

seanyoung commented 6 months ago

@Lichtso @LucasSte I've updated the PR, now all instructions are exercised.