Opened 4 years ago

Closed 7 months ago

#485 closed defect (fixed)

Random RasQL output

Reported by: pcampalani Owned by: dmisev
Priority: major Milestone: Future
Component: undecided Version: 8.5
Keywords: Cc: dmisev
Complexity: Hard

Description

WCPS systemtest query n.31 (Discrete_Fourier) apparently revealed a deviation in the RasQL output depending on the running machine.

The test query is:

for c in (rgb) return 
  encode(
    coverage DFT
    over $xx x(65:70),
         $xy y(65:70)
    values
        condense + 
        over $ux x(65:70),
             $uy y(65:70)
        using c[x($ux),y($uy)] * 
              cos((-2 * (22.0/7.0) ) *
                 (( (double) ($ux*$xx) / (70 - 65 + 1) ) + 
                 ( (double) ($uy*$xy) / (70 - 65 + 1) ))), 
    "png")

which translated to the RasQL equivalent:

select encode(marray i_i in [65:70, 65:70] values condense + over i_j in [65:70, 65:70] using (((c) [i_j[0],i_j[1]])*(cos((((-2)*((22.0)/(7.0)))*((((double)(((i_j[0])*(i_i[0]))/(((70)-(65))+(1))))+((double)(((i_j[1])*(i_i[1]))/(((70)-(65))+(1)))))))))), "PNG", "") from rgb AS c

Some cells returned from this query differ depending on the machine it runs on.

For instance, running the RasQL command in:

=== MACHINE 1 (Dimitar) =====================
  Distributor ID:    Ubuntu
  Description:    Ubuntu 12.10
  Release:    12.10
  Codename:    quantal
  arch: x86_64
  gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) 
=== MACHINE 2 (Piero) =======================
  Distributor ID:	Ubuntu
  Description:	Ubuntu 12.04.3 LTS
  Release:	12.04
  Codename:	precise
  arch: i386
  gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
=============================================

produce different output: see pics in attachment.
For more detailed analysis, the hexadecimal diff can be seen in the attachment query31.bundle. Follow the instructions to see the difference:

$ mkdir tmp
$ cd tmp
$ git init
$ git fetch /path/to/query31.bundle master:query31
$ git checkout query31
$ git log --oneline 
a69abe3 Piero RasQL output for WCPS test #31.
c44c683 Dimitar RasQL output for WCPS test #31.
$ git show --color-words
...

}}}

Attachments (5)

query31.bundle (824 bytes) - added by pcampalani 4 years ago.
git bundle for numerical evidence of the difference
31-Discrete_Fourier.test.oracle (131 bytes) - added by pcampalani 4 years ago.
PNG visualization (systemtest oracle)
31-Discrete_Fourier.test.out (131 bytes) - added by pcampalani 4 years ago.
PNG visualization (my output)
rasql_1.csv (990 bytes) - added by dmisev 4 years ago.
rasql_1_PIERO.csv (990 bytes) - added by pcampalani 4 years ago.
CSV output in my machine (@96)

Download all attachments as: .zip

Change History (11)

Changed 4 years ago by pcampalani

git bundle for numerical evidence of the difference

Changed 4 years ago by pcampalani

PNG visualization (systemtest oracle)

Changed 4 years ago by pcampalani

PNG visualization (my output)

comment:1 Changed 4 years ago by dmisev

Ok let's compare with CSV output, attached is my output from query

rasql -q 'select csv(marray i_i in [65:70, 65:70] values condense + over i_j in [65:70, 65:70] using (((c) [i_j[0],i_j[1]])*(cos((((-2)*((22.0)/(7.0)))*((((double)(((i_j[0])*(i_i[0]))/(((70)-(65))+(1))))+((double)(((i_j[1])*(i_i[1]))/(((70)-(65))+(1))))))))))) from rgb AS c' --out file

Changed 4 years ago by dmisev

comment:2 Changed 4 years ago by pcampalani

And here is mine (attached).

I ran a diff on the single tuples (in vim :%s/"}\?,{\?"/\r/g then diff the files in the shell):

$ diff rasql_1.csv rasql_1_PIERO.csv 
3c3
< 2.70319 4.72491 11.5895
---
> 2.70319 4.72491 5.63355

So there is only a difference in the single BLUE value of the third cell.

Changed 4 years ago by pcampalani

CSV output in my machine (@96)

comment:3 Changed 3 years ago by dmisev

I think it is important to take a look at this, queries should return same results irrelevant of the environment.

Best way to tackle it is to try and simplify the query as much as possible, until it doesn't produce different result anymore.

Veranika, please run the query test on your machine and compare the csv output to find out which one it matches.

comment:4 Changed 3 years ago by dmisev

The output is random actually, and the problematic byte changes on every query run. So no need to compare actually, it's easily reproducible.

comment:5 Changed 3 years ago by dmisev

  • Summary changed from Different RasQL output depending on platforms to Random RasQL output

comment:6 Changed 7 months ago by dmisev

  • Resolution set to fixed
  • Status changed from new to closed

Cannot reproduce it anymore, seems like we have fixed it. I submitted a patch to remove this query from known_fails.

Note: See TracTickets for help on using tickets.