Project

General

Profile

Actions

Bug #15552

closed

app_aobench.rb is broken

Added by Eregon (Benoit Daloze) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
[ruby-core:91194]

Description

Specifically, the image generated is incorrect.
When modifying the footer of the benchmark like this:

alias printf_orig printf
def printf *args
  $fp.printf(*args)
end

File.open("ao.ppm", "w") do |fp|
  $fp = fp
  printf("P6\n")
  printf("%d %d\n", IMAGE_WIDTH, IMAGE_HEIGHT)
  printf("255\n")
  Scene.new.render(IMAGE_WIDTH, IMAGE_HEIGHT, NSUBSAMPLES)
end

undef printf
alias printf printf_orig

Here is the expected image:
ao_ref
I get this image with MRI 2.6.0:
ao_mri_2_6_0
And interestingly, TruffleRuby 1.0.0-rc11 renders an image closer to the expected one:
ao_tr_rc11

I guess this might be both an interpreter bug, and possibly also a bug in the benchmark code.

I think every benchmark should have some validation, otherwise it's prone to measure something unexpected like this.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0