<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>143376</bug_id>
          
          <creation_ts>2015-04-03 08:58:21 -0700</creation_ts>
          <short_desc>FTL JIT tests should fail if JSC is built without FTL JIT support</short_desc>
          <delta_ts>2016-01-07 07:36:28 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>143374</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Csaba Osztrogonác">ossy</reporter>
          <assigned_to name="Csaba Osztrogonác">ossy</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
    
    <cc>ossy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1082576</commentid>
    <comment_count>0</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2015-04-03 08:58:21 -0700</bug_when>
    <thetext>Now we can build JSC without FTL JIT and can execute run-javascriptcore-tests with --ftl-jit 
accidentally and all tests pass. The problem is that useFTLJIT options is silently set to false:
http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/runtime/Options.cpp#L233</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1082577</commentid>
    <comment_count>1</comment_count>
      <attachid>250077</attachid>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2015-04-03 08:59:59 -0700</bug_when>
    <thetext>Created attachment 250077
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084692</commentid>
    <comment_count>2</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2015-04-12 14:05:59 -0700</bug_when>
    <thetext>ping?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084701</commentid>
    <comment_count>3</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-04-12 15:58:41 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; ping?

Why is this desirable behavior?

We don&apos;t do this for any of the other JIT tiers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084739</commentid>
    <comment_count>4</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2015-04-12 23:30:32 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; ping?
&gt; 
&gt; Why is this desirable behavior?
&gt; 
&gt; We don&apos;t do this for any of the other JIT tiers.

Because FTL JIT is the only one tier which is disabled by default on Linux
platforms and the only one tier which has to be enabled with explicit command
line option of build-jsc / build-webkit / run-javascriptcore-tests.

It&apos;s so easy to miss --ftl-jit accidentally during development. I&apos;d like
to add this extra check to avoid getting false positive FTL JIT test passes
when FTL JIT isn&apos;t built at all. ftlCrashesIfCantInitializeLLVM option
is true only if you call JSC from run-javascriptcore-tests and FTL JIT
build is disabled only on non Apple Mac platforms, so this check wouldn&apos;t
affect Apple Mac port at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084833</commentid>
    <comment_count>5</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-04-13 09:47:16 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; ping?
&gt; &gt; 
&gt; &gt; Why is this desirable behavior?
&gt; &gt; 
&gt; &gt; We don&apos;t do this for any of the other JIT tiers.
&gt; 
&gt; Because FTL JIT is the only one tier which is disabled by default on Linux
&gt; platforms and the only one tier which has to be enabled with explicit command
&gt; line option of build-jsc / build-webkit / run-javascriptcore-tests.
&gt; 
&gt; It&apos;s so easy to miss --ftl-jit accidentally during development. I&apos;d like
&gt; to add this extra check to avoid getting false positive FTL JIT test passes
&gt; when FTL JIT isn&apos;t built at all. ftlCrashesIfCantInitializeLLVM option
&gt; is true only if you call JSC from run-javascriptcore-tests and FTL JIT
&gt; build is disabled only on non Apple Mac platforms, so this check wouldn&apos;t
&gt; affect Apple Mac port at all.

Wouldn&apos;t it be cleaner and simpler to just remove the --ftl-jit option?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084834</commentid>
    <comment_count>6</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-04-13 09:47:17 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; ping?
&gt; &gt; 
&gt; &gt; Why is this desirable behavior?
&gt; &gt; 
&gt; &gt; We don&apos;t do this for any of the other JIT tiers.
&gt; 
&gt; Because FTL JIT is the only one tier which is disabled by default on Linux
&gt; platforms and the only one tier which has to be enabled with explicit command
&gt; line option of build-jsc / build-webkit / run-javascriptcore-tests.
&gt; 
&gt; It&apos;s so easy to miss --ftl-jit accidentally during development. I&apos;d like
&gt; to add this extra check to avoid getting false positive FTL JIT test passes
&gt; when FTL JIT isn&apos;t built at all. ftlCrashesIfCantInitializeLLVM option
&gt; is true only if you call JSC from run-javascriptcore-tests and FTL JIT
&gt; build is disabled only on non Apple Mac platforms, so this check wouldn&apos;t
&gt; affect Apple Mac port at all.

Wouldn&apos;t it be cleaner and simpler to just remove the --ftl-jit option?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084853</commentid>
    <comment_count>7</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2015-04-13 10:19:12 -0700</bug_when>
    <thetext>Removing the --ftl-jit option of what? build-jsc and build-webkit has
this option to enable building FTL JIT if it isn&apos;t built by default.
run-javascriptcore-tests has this option to enable FTL JIT tests too,
because run-jsc-stress-tests doesn&apos;t know how did you build JSC.

Removing --useFTLJIT command line argument of JSC wouldn&apos;t work,
because run-jsc-stress-tests still doesn&apos;t how did you build JSC
and it passes --useFTLJIT=false as base options and passes
--useFTLJIT=true as FTL options.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084863</commentid>
    <comment_count>8</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-04-13 10:30:48 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Removing the --ftl-jit option of what? build-jsc and build-webkit has
&gt; this option to enable building FTL JIT if it isn&apos;t built by default.
&gt; run-javascriptcore-tests has this option to enable FTL JIT tests too,
&gt; because run-jsc-stress-tests doesn&apos;t know how did you build JSC.

Remove all of them.  On x86_64 Linux, and on all 64-bit Darwins, we just build it.

I get what scenario you&apos;re worried about - you want to test FTL, but you didn&apos;t build it, and so you get surprised.  We found that we didn&apos;t need it.

We had an option in the tests that was exactly like what you proposed - but it caused strange issues.  For example, someone would intentionally tweak something in a way that disabled FTL even though --ftl-jit was provided, and they&apos;d get test failures and spend some time scratching their heads.  Eventually, we found that forcing test failures when the FTL JIT was disabled wasn&apos;t worth it once we just had FTL enabled across the board.  When we do want to validate that our performance features are enabled, we just rely on performance tests.  The difference in execution time of things like Octane is pretty obvious.  But, we haven&apos;t had this issue in a long time.

I suspect that the Linux ports are no different.  Once it&apos;s enabled, then that&apos;s that.  We don&apos;t have to worry about accidentally disabling it.

Is there some scenario that you hit often that involves the FTL JIT accidentally being disabled, and the only way to validate this is to force test failures?

&gt; 
&gt; Removing --useFTLJIT command line argument of JSC wouldn&apos;t work,
&gt; because run-jsc-stress-tests still doesn&apos;t how did you build JSC
&gt; and it passes --useFTLJIT=false as base options and passes
&gt; --useFTLJIT=true as FTL options.

I don&apos;t want to remove that option.  I&apos;m only talking about the --ftl-jit options to the build scripts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1087795</commentid>
    <comment_count>9</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2015-04-23 05:12:54 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; Removing the --ftl-jit option of what? build-jsc and build-webkit has
&gt; &gt; this option to enable building FTL JIT if it isn&apos;t built by default.
&gt; &gt; run-javascriptcore-tests has this option to enable FTL JIT tests too,
&gt; &gt; because run-jsc-stress-tests doesn&apos;t know how did you build JSC.
&gt; 
&gt; Remove all of them.  On x86_64 Linux, and on all 64-bit Darwins, we just
&gt; build it.

To make it clear FTL JIT is _disabled_ by default 
on all Linux platforms because of many reasons:
- The necessary pathces for X86_64 can be found only in LLVM 3.6 which
isn&apos;t shipped yet by Ubuntu. Ubuntu 15.04 will ship LLVM 3.6 , the planned
release date is today, but isn&apos;t released yet. (Of course it can be
workaroundable with jhbuild - we do it now)
- There are many crashes with FTL JIT on Linux (X86_64 and AArch64 too):
bug143087 and bug143089
- performance regressions on SunSpider and V8: bug143822

I don&apos;t think if anybody wants to enable a feature which 
slows down the runtime and makes JSC crash sometimes. These 
bugs should be fixed before enabling FTL JIT by default.
 
&gt; I get what scenario you&apos;re worried about - you want to test FTL, but you
&gt; didn&apos;t build it, and so you get surprised.  We found that we didn&apos;t need it.
&gt; 
&gt; We had an option in the tests that was exactly like what you proposed - but
&gt; it caused strange issues.  For example, someone would intentionally tweak
&gt; something in a way that disabled FTL even though --ftl-jit was provided, and
&gt; they&apos;d get test failures and spend some time scratching their heads. 

I don&apos;t understand this problem, the proposed change would provide simple
and clear error message if you build JSC with disabled FTL JIT, but try
to run tests with run-javascriptcore-tests with --ftl-jit (which passes
--useFTLJIT=true and --ftlCrashesIfCantInitializeLLVM=true)

There is _no_ reason to run tests twice, first time with useFTLJIT=false
and then with useFTLJIT=true, because useFTLJIT will be set to false
if FTL JIT was disabled in build time. It is wasting of time, nothing else. For example the Apple Windows bots ran tests twice due to this bug
until I disabled it. (https://trac.webkit.org/changeset/179190)

The root of the problem is that run-jsc-stress-tests doesn&apos;t 
know if JSC was built with enabled or disabled FTL JIT.

&gt; Eventually, we found that forcing test failures when the FTL JIT was
&gt; disabled wasn&apos;t worth it once we just had FTL enabled across the board. 
&gt; When we do want to validate that our performance features are enabled, we
&gt; just rely on performance tests.  The difference in execution time of things
&gt; like Octane is pretty obvious.  But, we haven&apos;t had this issue in a long
&gt; time.
&gt; 
&gt; I suspect that the Linux ports are no different.  Once it&apos;s enabled, then
&gt; that&apos;s that.  We don&apos;t have to worry about accidentally disabling it.

But the problem is that FTL JIT isn&apos;t enabled by default,
we have to enable explicitly now. I don&apos;t think if it will
be disabled accidentally by a change ever.
 
&gt; Is there some scenario that you hit often that involves the FTL JIT
&gt; accidentally being disabled, and the only way to validate this is to force
&gt; test failures?

Not so often, but more then 1-2 times I missed to pass --ftl-jit to
build-jsc and noticed this user error hours later when stress/performance
tests finished. With this patch I could have caught it at the beginning.
 
&gt; &gt; Removing --useFTLJIT command line argument of JSC wouldn&apos;t work,
&gt; &gt; because run-jsc-stress-tests still doesn&apos;t how did you build JSC
&gt; &gt; and it passes --useFTLJIT=false as base options and passes
&gt; &gt; --useFTLJIT=true as FTL options.
&gt; 
&gt; I don&apos;t want to remove that option.  I&apos;m only talking about the --ftl-jit
&gt; options to the build scripts.

I have strong objection against removing --ftl-jit option
until it is enabled by default on X86_64 and AArch64 Linux.
We should be able to enable FTL JIT with command line options,
not only with modifying the build system.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1153350</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-01-06 20:36:04 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; I have strong objection against removing --ftl-jit option
&gt; until it is enabled by default on X86_64 and AArch64 Linux.
&gt; We should be able to enable FTL JIT with command line options,
&gt; not only with modifying the build system.

Hi from 2016. Do we still want this patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1153410</commentid>
    <comment_count>11</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2016-01-07 07:35:51 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; Hi from 2016. Do we still want this patch?

Filip doesn&apos;t want this change and it isn&apos;t so important for me.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>250077</attachid>
            <date>2015-04-03 08:59:59 -0700</date>
            <delta_ts>2016-01-07 07:36:28 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-143376-20150403085912.patch</filename>
            <type>text/plain</type>
            <size>1370</size>
            <attacher name="Csaba Osztrogonác">ossy</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTgyMzE3CmRpZmYgLS1naXQgYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvQ2hhbmdlTG9nIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwppbmRleCAy
MGJmODJhODQ0ZGFhZjNlNTc4MGYxYWUwOGRjMmJlNTdlNGM3ZTA3Li5mYmIwM2FhZmVlOTZiMGJh
MDMzMjNkZjI0M2U3ZDU4YTgxMzlmODNmIDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlwdENv
cmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxMyBAQAorMjAxNS0wNC0wMyAgQ3NhYmEgT3N6dHJvZ29uw6FjICA8b3NzeUB3ZWJraXQu
b3JnPgorCisgICAgICAgIEZUTCBKSVQgdGVzdHMgc2hvdWxkIGZhaWwgaWYgSlNDIG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