Closed Bug 711370 Opened 8 years ago Closed 8 years ago

merge tr-float into tamarin-redux

Categories

(Tamarin Graveyard :: Tools, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: brbaker, Unassigned)

References

Details

Attachments

(4 files, 2 obsolete files)

Need to merge the tr-float repo into tamarin-redux. The float code will be merged in with the ifdef disabled.
Flags: flashplayer-triage+
Flags: flashplayer-qrb+
Flags: flashplayer-bug-
Attached patch disable float (obsolete) — Splinter Review
NOTE: You MUST also rebuild the builtins and the shell_toplevel but I have NOT included them in this patch.
Also note we need to merge fr-float to flashruntime-redux roughly at the same time.
Depends on: 711153
Will also need to remove asc.jar from the utils/ directory. Although it might make sense to just replace with the one that the build system normally grabs so that it is just there.
Attached patch v2. disable float (obsolete) — Splinter Review
Attachment #582234 - Attachment is obsolete: true
Steps to disable float in order to run a buildbot sandbox:

1) apply the "v2. disable float" and "revert changes for bz# 692402" patches
2) replace utils/asc.jar with the asc.jar that is used in tamarin-redux
3) rebuild the builtin: 
    cd core; ./builtin.py -config CONFIG::VMCFG_FLOAT=false
4) rebuild the shell_toplevel
    cd shell; ./shell_toplevel.py
5) remove the utils/asc.jar
    hg remove -f utils/asc.jar (need to force since we modified it in step 2)
Depends on: 711471
updated patch for new AMF testcase
Attachment #582265 - Attachment is obsolete: true
Attached file max x86 performance
Performance comparison between tr-float (+ merge patches) and tr using v8.5 and ascmicro. There are a couple of performance drops that should be looked into as they were repeatable. (see attachment for full log)

Build: ../configure.py --target=i686-darwin
Machine: MacBook Pro 2.66 GHz core i7, 8GB ram

                                        avm            avm2
test                           best     avg    best     avg   %dBst   %dAvg
Metric: iterations/second 
Dir: asmicro/
  bytearray-write-int-2        19.4    19.2    17.2    17.0   -11.1   -11.9 --
 bytearray-write-position-1   238.8   207.4   190.8   188.9   -20.1    -8.9 --
  globalvar-write-1          6410.6  6169.2  4878.1  4813.8   -23.9   -22.0 --
  vector-read-char-2          142.4   141.9   135.1   134.9    -5.2    -5.0 --
  vector-write-int-4          425.1   424.5   407.2   403.8    -4.2    -4.9 -
avm1 is tr-float-merge (float disabled)
avm2 is tr
asc is my "standard" asc
5 iterations

Machine is 2009-era Mac Pro 2 x 2.93GHz Quad-core Xeon, 16GB RAM.

These are the runs with significant differences:

  alloc-10                     11.0    10.9    12.6    12.3    14.9    12.4 ++
  alloc-4                      54.1    53.9    56.8    56.8     5.1     5.2 ++
  alloc-5                      35.7    35.7    39.6    39.6    11.1    10.9 ++
  arguments-1                 910.1   909.3   856.1   855.5    -5.9    -5.9 --
  arguments-2                 489.5   488.5   605.4   603.3    23.7    23.5 ++
  array-init-1                488.0   487.5   521.0   520.4     6.7     6.7 ++
  array-init-2                509.0   508.3   540.5   539.6     6.2     6.2 ++
  array-sort-4                 11.6    11.6    10.9    10.9    -6.0    -6.0 --
  bytearray-read-byte-2       106.9   106.6    96.0    96.0   -10.2    -9.9 --
  bytearray-read-byte-3        98.9    98.8    92.4    92.2    -6.6    -6.6 --
  bytearray-write-bool-1       19.0    19.0    20.0    19.9     5.0     4.8 ++
  bytearray-write-float-1      13.7    13.7    12.8    12.6    -6.7    -8.1 --
  bytearray-write-float-2      13.3    13.2    15.3    15.2    14.9    14.8 ++
  bytearray-write-short-1      14.9    14.9    16.6    16.6    11.5    11.4 ++
  bytearray-write-uint-1       13.5    13.4    15.3    15.2    12.9    13.3 ++
  closedvar-read-1           5021.0  4992.2  4732.3  4723.5    -5.8    -5.4 --
  closedvar-write-1          5232.8  5201.2  1271.7  1269.7   -75.7   -75.6 --
  closedvar-write-2          5641.4  5545.9  1273.7  1271.7   -77.4   -77.1 --
  globalvar-write-1          6264.7  6185.2  5436.6  5387.8   -13.2   -12.9 --
  lookup-array-in-1          1992.0  1989.6  1889.1  1887.1    -5.2    -5.2 --
  lookup-negindex-array-2     343.3   342.5   317.7   317.2    -7.5    -7.4 --
  lookup-negindex-object-2    476.5   475.2   420.2   419.3   -11.8   -11.8 --
  lookup-object-in-1         1721.3  1719.1  1621.4  1620.6    -5.8    -5.7 --
  restarg-1                   912.1   910.7   857.1   855.2    -6.0    -6.1 --
  restarg-2                   512.0   510.7   575.8   575.0    12.5    12.6 ++
  string-indexOf-2            151.2   151.1   193.6   193.5    28.0    28.1 ++
  try-2                        17.4    17.1    16.0    15.9    -8.0    -7.3 --
  vector-init-1               283.9   283.5   301.4   300.7     6.2     6.1 ++
  vector-init-3               198.8   198.5   210.9   210.7     6.1     6.1 ++
  vector-init-4               163.7   163.6   174.7   174.4     6.7     6.6 ++
  vector-write-Boolean-1       85.8    85.6    93.2    92.9     8.5     8.5 ++
  vector-write-C-1             82.5    82.3    93.3    93.1    13.0    13.0 ++
  vector-write-C-2             82.4    82.3    93.3    93.2    13.3    13.2 ++
  vector-write-int-3          431.6   431.1   409.2   408.1    -5.2    -5.3 --
  vector-write-int-4          431.1   430.9   408.6   408.0    -5.2    -5.3 --
(In reply to Lars T Hansen from comment #9)
> avm1 is tr-float-merge (float disabled)
> avm2 is tr
> asc is my "standard" asc
> 5 iterations

Don't forget that the numbers your are quoting here are sort of reversed, ++ means that it slowed down and --  means it sped up.

I am not seeing the same slow downs on my MacPro 2x2.66 GHz 6-core (14GB RAM). I am consistently seeing the following tests have large slow downs though. I am using asc.jar 5:538407228468 (from ftp://asteam/asc/latest/asc.jar)

avm1: tamarin-redux 6792:df3af1b524ea
avm2: tr-float 7126:691482212b4c (plus comment #6 steps)

32bit release


                                        avm            avm2
test                           best     avg    best     avg   %dBst   %dAvg
Metric: iterations/second 
Dir: asmicro/
 bytearray-write-position-1   223.6   223.3   177.3   176.8   -20.7   -20.8 --
  closedvar-write-2          4966.0  4913.5  4483.5  4468.1    -9.7    -9.1 --
  globalvar-write-1          5999.0  5990.0  4465.5  4441.2   -25.6   -25.9 --
  try-1                       250.5   242.3   221.3   204.7   -11.6   -15.5 -
(In reply to Lars T Hansen from comment #9)
> avm1 is tr-float-merge (float disabled)
> avm2 is tr

This is incorrect, it's the other way around, and I really have checked this.  Consequently negative results are slowdowns in tr-float, positive results are speedups, compared to the baseline.
2008 MacBook Pro, core-2-duo, 2.6GHz, 4GB RAM, otherwise identical setup.  Again, avm1 is tamarin-redux, avm2 is tr-float-merge.

  alloc-4                      37.3    37.0    39.5    39.3     5.8     6.3 ++
  alloc-8                      8.48    7.85    7.51    7.43   -11.4    -5.4 --
  arguments-1                 652.7   649.3   612.8   609.9    -6.1    -6.1 --
  array-foreach-func          238.8   238.7   252.0   251.8     5.5     5.5 ++
  array-init-1                344.7   344.2   364.9   364.6     5.9     5.9 ++
  array-init-4                219.3   219.1   236.8   236.4     7.9     7.9 ++
  array-push-1                221.6   221.4   243.0   241.7     9.7     9.2 ++
  array-read-Number-2          20.6    20.6    22.3    22.3     8.1     8.1 ++
  array-unshift-1             134.3   134.3   147.7   147.6    10.0    10.0 ++
  array-write-Number-1         14.7    14.3    12.9    12.8   -12.2   -10.8 --
  array-write-Number-2         11.1    10.9    9.99    9.93   -10.1    -8.9 --
  bytearray-read-byte-2        79.4    79.4    75.3    75.2    -5.2    -5.2 --
  bytearray-read-byte-3        76.2    76.1    65.2    65.1   -14.5   -14.4 --
  bytearray-read-double-1      12.3    12.3    11.6    11.6    -5.8    -5.8 --
  bytearray-read-int-1         18.2    18.2    19.3    19.0     6.0     4.4 ++
  bytearray-read-length-1     131.3   131.2   121.0   120.9    -7.9    -7.8 --
  bytearray-read-position-1   120.9   120.9   131.0   130.9     8.3     8.3 ++
  bytearray-read-short-1       19.6    19.6    21.7    21.7    10.9    10.8 ++
  bytearray-read-utf-2         2.80    2.79    2.41    2.41   -13.8   -13.9 --
  bytearray-read-utfbytes-2    2.79    2.79    2.41    2.41   -13.7   -13.7 --
  bytearray-write-int-1        11.9    11.9    12.7    12.7     6.3     6.6 ++
  bytearray-write-int-2        12.6    12.6    11.9    11.9    -5.9    -5.8 --
 bytearray-write-position-1   157.2   156.1   134.3   134.2   -14.6   -14.0 --
  bytearray-write-short-1      14.2    14.2    15.0    15.0     5.9     5.8 ++
 bytearray-write-utfbytes-1    44.7    44.6    47.1    46.9     5.3     5.2 ++
  closedvar-read-1           4434.6  4430.8  3701.3  3633.0   -16.5   -18.0 --
  closedvar-write-1          3404.6  3393.0  2983.0  2960.0   -12.4   -12.8 --
  funcall-2                   249.3   248.9   265.9   265.6     6.7     6.7 ++
  funcall-3                   254.0   253.9   278.7   278.2     9.7     9.6 ++
  globalvar-read-1           4446.6  4441.2  3725.3  3684.3   -16.2   -17.0 --
  globalvar-write-1          2972.0  2964.2  3318.7  3245.0    11.7     9.5 ++
  lookup-array-fetch-1        537.9   537.7   504.5   504.1    -6.2    -6.3 --
  lookup-negindex-array-2     271.9   271.7   255.2   255.2    -6.1    -6.0 --
  lookup-negindex-object-2    369.9   369.7   328.3   328.1   -11.2   -11.3 --
  lookup-object-fetch-1       649.7   649.4   613.4   612.9    -5.6    -5.6 --
  lookup-object-in-1         1342.7  1341.3  1269.7  1267.9    -5.4    -5.5 --
  object-read-length-1        215.4   215.2   227.5   227.3     5.7     5.6 ++
  oop-1                        2.88    2.88    3.15    3.15     9.3     9.3 ++
  regex-exec-1                 47.3    47.2   274.6    92.9   480.1    97.1 ++
  regex-exec-2                 55.6    55.4    59.5    58.8     6.9     6.0 ++
  restarg-1                   652.7   652.5   613.4   612.3    -6.0    -6.2 --
  string-fromCharCode-2        55.8    55.7    60.6    60.5     8.7     8.6 ++
  string-indexOf-2            115.2   115.0   146.1   146.0    26.9    26.9 ++
  string-lastIndexOf-1        488.5   487.9   446.6   446.2    -8.6    -8.6 --
  string-substring-1          124.6   124.4   115.8   115.6    -7.1    -7.1 --
  vector-init-3               129.2   129.1   139.6   139.6     8.0     8.1 ++
  vector-init-4               114.8   114.7   125.6   125.6     9.5     9.5 ++
  vector-write-C-1             65.2    64.5    71.4    71.3     9.5    10.4 ++
  vector-write-C-2             65.0    65.0    71.7    71.7    10.3    10.3 ++
  vector-write-int-4          364.6   364.1   346.0   345.8    -5.1    -5.0 --
And both builds are release builds.
These are my binaries again on the core-2-duo macbook pro, but after rebooting:

  alloc-4                      37.8    37.8    40.5    40.4     7.1     7.1 ++
  arguments-1                 664.7   663.9   607.4   606.5    -8.6    -8.6 --
  array-1                    3879.1  3852.9  4140.9  4138.3     6.7     7.4 ++
  array-init-1                345.0   344.9   368.3   368.1     6.8     6.7 ++
  array-push-1                220.8   220.6   244.5   242.9    10.7    10.1 ++
  array-unshift-1             135.1   135.1   148.7   148.2    10.1     9.7 ++
  array-write-C-1              34.8    34.7    36.6    36.6     5.4     5.4 ++
  array-write-Number-1         14.7    14.4    12.7    12.7   -13.1   -12.0 --
  array-write-Number-2         11.2    11.1    9.97    9.88   -10.9   -11.1 --
  bytearray-read-byte-2        81.7    81.7    75.8    75.8    -7.1    -7.2 --
  bytearray-read-byte-3        75.8    75.8    68.5    68.4    -9.7    -9.7 --
  bytearray-read-double-2      19.6    19.5    20.7    20.7     5.9     5.9 ++
  bytearray-read-float-1       14.0    14.0    13.2    13.2    -5.9    -5.9 --
  bytearray-read-int-1         18.2    18.1    19.4    18.9     6.8     4.5 ++
  bytearray-read-ubyte-1       20.8    20.8    19.7    19.7    -5.2    -5.3 --
  bytearray-read-uint-2        22.1    22.1    20.7    20.7    -6.3    -6.3 --
  bytearray-read-utf-2         2.80    2.80    2.42    2.42   -13.5   -13.5 --
  bytearray-read-utfbytes-2    2.80    2.79    2.41    2.41   -13.9   -13.8 --
  bytearray-write-byte-3       56.7    55.9    60.4    60.4     6.5     8.0 ++
  bytearray-write-bytes-1      15.7    15.6    16.5    16.5     5.1     5.2 ++
  bytearray-write-float-1      10.9    10.9    10.2    10.2    -6.6    -6.6 --
  bytearray-write-float-2      12.4    12.3    13.7    13.6    10.5    10.9 ++
  bytearray-write-int-1        12.0    12.0    12.7    12.7     5.7     5.7 ++
 bytearray-write-position-1   148.7   148.5   135.7   135.1    -8.7    -9.0 --
 bytearray-write-utfbytes-1    45.1    45.1    48.0    47.7     6.2     5.8 ++
  closedvar-write-1          3532.5  3517.7  3160.8  3141.1   -10.5   -10.7 --
  globalvar-read-1           4426.6  4423.6  3884.1  3851.9   -12.3   -12.9 --
  globalvar-write-1          3676.3  3668.5  3160.8  3147.5   -14.0   -14.2 --
  lookup-array-in-1          1646.4  1646.0  1519.5  1518.7    -7.7    -7.7 --
  lookup-negindex-array-2     274.5   274.4   255.7   255.6    -6.8    -6.9 --
  lookup-negindex-object-2    372.3   372.3   330.3   329.6   -11.3   -11.5 --
  lookup-object-in-1         1351.6  1345.9  1276.7  1273.5    -5.5    -5.4 --
  object-read-length-1        215.6   215.2   227.8   227.8     5.7     5.8 ++
  oop-1                        2.88    2.88    3.19    3.19    10.7    10.9 ++
  restarg-1                   665.3   663.8   606.8   605.3    -8.8    -8.8 --
  string-fromCharCode-2        56.4    56.3    60.6    60.5     7.5     7.5 ++
  string-indexOf-2            115.2   115.0   146.1   146.0    26.9    27.0 ++
  string-lastIndexOf-1        488.5   488.5   446.6   446.6    -8.6    -8.6 --
  try-1                       210.6   210.4   198.2   198.0    -5.9    -5.9 --
  vector-init-2               230.8   230.6   243.3   243.1     5.4     5.4 ++
  vector-init-3               129.5   128.9   141.7   141.6     9.4     9.8 ++
  vector-init-4               115.4   115.4   125.9   125.8     9.1     9.0 ++
  vector-write-C-1             65.8    65.6    72.9    72.8    10.7    11.0 ++
  vector-write-C-2             65.7    65.6    73.1    72.9    11.3    11.2 ++
  vector-write-int-3          368.8   368.8   346.0   345.7    -6.2    -6.2 --
  vector-write-int-4          369.5   369.3   346.0   345.6    -6.4    -6.4 --
And these are Brent's binaries on the same machine:

  alloc-1                      37.2    37.1    34.6    34.5    -7.1    -7.0 --
  alloc-2                      19.5    19.4    17.7    17.6    -9.1    -9.4 --
  alloc-3                      12.6    12.4    11.9    11.9    -5.4    -3.8 --
  alloc-7                      28.4    28.4    30.9    30.9     8.6     8.7 ++
  array-2                     491.5   490.5   522.0   521.1     6.2     6.2 ++
  array-foreach-func          222.3   222.0   240.8   240.6     8.3     8.4 ++
  array-pop-1                 314.4   312.2   340.7   334.7     8.4     7.2 ++
  array-push-1                226.3   226.1   256.2   255.6    13.2    13.0 ++
  array-unshift-1             134.9   134.8   146.9   146.5     8.8     8.6 ++
  bytearray-read-uint-1        19.6    19.4    18.4    18.4    -5.8    -5.3 --
  bytearray-read-uint-2        24.8    24.7    22.9    22.8    -7.6    -7.4 --
  bytearray-read-utf-2         2.61    2.60    2.89    2.89    11.0    11.1 ++
  bytearray-read-utfbytes-1    23.5    23.4    24.8    24.8     5.7     5.8 ++
  bytearray-read-utfbytes-2    2.60    2.58    2.90    2.89    11.5    11.8 ++
  bytearray-write-short-1      13.9    13.9    11.7    11.7   -15.5   -15.6 --
  closedvar-read-1           3801.2  3794.6  4429.6  4423.0    16.5    16.6 ++
  closedvar-write-1          3131.9  3106.5  3504.5  3474.7    11.9    11.9 ++
  closedvar-write-2          3333.7  3323.3  3627.4  3615.6     8.8     8.8 ++
  globalvar-write-1          3742.3  3729.9  3356.6  3337.3   -10.3   -10.5 --
  object-read-length-1        215.4   215.4   227.9   227.8     5.8     5.8 ++
  string-indexOf-3             63.5    63.4    59.2    59.0    -6.8    -7.1 --
  string-lastIndexOf-1        476.5   476.0   446.6   445.1    -6.3    -6.5 --
  vector-write-int-3          374.9   374.5   341.0   340.8    -9.0    -9.0 --
  vector-write-int-4          374.6   374.4   342.3   342.3    -8.6    -8.6 --
The ones appearing with slowdowns on both lists:

bytearray-read-uint-2
globalvar-write-1
string-lastIndexOf-1
vector-write-int-3
vector-write-int-4
Brent's binaries were built with configure.py and gcc 4.2.1, mine were built with Xcode and gcc 4.0.  The optimization level was -O3 in both cases.  Binary sizes were comparable, after stripping.
(In reply to Lars T Hansen from comment #16)
> The ones appearing with slowdowns on both lists:
> 
> bytearray-read-uint-2
> globalvar-write-1
> string-lastIndexOf-1
> vector-write-int-3
> vector-write-int-4

And of those, the only ones appearing with slowdowns in the list from the mac pro are the globalvar benchmark, which we should discount because we know it to be noisy, and the vector write benchmarks.
scimark and jsbench look fine.  there are some speedups on typed scimark, maybe from the finddef optimizations in tr-float.
tamarin-redux:

changeset:   7126:691482212b4c
tag:         tip
parent:      7099:c678012ff380
parent:      7125:df3af1b524ea
user:        Lars T Hansen <lhansen@adobe.com>
date:        Mon Dec 19 11:48:02 2011 +0100
summary:     Merged from tamarin-redux 6792:df3af1b524ea
changeset: 7128:7b00f4c0a37c
user:      Brent Baker <brbaker@adobe.com>
summary:   Bug 711370: Disable float by default

http://hg.mozilla.org/tamarin-redux/rev/7b00f4c0a37c
changeset: 7130:b2feca635e7c
user:      Brent Baker <brbaker@adobe.com>
summary:   Bug 711370: remove the utils/abcdump.abc since it didn't used to exist in tamarin-redux and also since what was checked in was something that was built with --abcfuture. Also needed to remove the float4 data type declaration in abcdump, changed to * in order to get it to compile

http://hg.mozilla.org/tamarin-redux/rev/b2feca635e7c
AOT compilation problems:

The AOT system makes greater demands on the AS3/native interface than the regular runtime does.  Specifically, the AOT system names the methods in classes that will be used by the thunking layer, for example:

AVMTHUNK_NATIVE_METHOD(__AS3___vec_Vector_object_AS3_pop, avmplus::ObjectVectorObject::AS3_pop)

and there's some casting of avmplus::ObjectVectorObject::AS3_pop going on behind the scenes.

This fails to work when AS3_pop is overloaded.  The float merge has introduced several such overloads:

* AS3_pop and AS3_shift are overloaded on all the vector objects because float4_t
  requires a different return protocol (pass in a box to store the result in)
* ByteArrayObject has overloaded readFloat and writeFloat: there are the externally
  visible ones and the internal helpers with different signatures.

The latter are easily fixed, but the AS3_pop / AS3_shift will require more work.  

(In a sense the AOT layer has no business knowing the names called by the thunking layer, so that needs investigation.)
The easy fix is to introduce the necessary cast to disambiguate the method the AOT system sees, but is that correct?  That seems unlikely.
No - the *easy* fix is to recognize that the overloaded methods are only needed if float/float4 are enabled, and wrap them in #ifdef VMCFG_FLOAT...  Patch coming up.
changeset:   7131:6fee29500342
tag:         tip
user:        Lars T Hansen <lhansen@adobe.com>
date:        Wed Dec 21 14:58:03 2011 +0100
summary:     Disambiguate for AOT by hiding or renaming overloaded names
Adds compilation of release and debug builds with float enabled and then tests both shells in hybrid and -Ojit modes.
Attachment #585474 - Flags: review?(dschaffe)
changeset: 7136:3c9c976107e0
user:      Brent Baker <brbaker@adobe.com>
summary:   Bug 711370: fix the windows deep code coverage compilation

http://hg.mozilla.org/tamarin-redux/rev/3c9c976107e0
Attachment #585474 - Flags: review?(dschaffe) → review+
changeset: 7139:c0c55e9ab2a7
user:      Brent Baker <brbaker@adobe.com>
summary:   Bug 711370: Add float compilation and testing to deep buildbot

http://hg.mozilla.org/tamarin-redux/rev/c0c55e9ab2a7
changeset: 7141:0e8b3e5f23d4
user:      Brent Baker <brbaker@adobe.com>
summary:   Bug 711370: fix how the generated files are reverted so that it works properly on windows via cygwin

http://hg.mozilla.org/tamarin-redux/rev/0e8b3e5f23d4
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
changeset: 7204:6b939613dea3
user:      Brent Baker <brbaker@adobe.com>
summary:   Bug 711370: need to exclude the asmicro/float* tests from running when doing a performance run as float is not enabled by default and the available compiler does not support float

http://hg.mozilla.org/tamarin-redux/rev/6b939613dea3
You need to log in before you can comment on or make changes to this bug.