<?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>223757</bug_id>
          
          <creation_ts>2021-03-25 12:09:48 -0700</creation_ts>
          <short_desc>Embiggen maximum HashTable size when not using ANGLE</short_desc>
          <delta_ts>2021-04-19 09:59:40 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Don Olmstead">don.olmstead</reporter>
          <assigned_to name="Don Olmstead">don.olmstead</assigned_to>
          <cc>achristensen</cc>
    
    <cc>benjamin</cc>
    
    <cc>cdumez</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>sam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1743858</commentid>
    <comment_count>0</comment_count>
    <who name="Don Olmstead">don.olmstead</who>
    <bug_when>2021-03-25 12:09:48 -0700</bug_when>
    <thetext>A HashMap of sh::ShaderVariable is over the limit introduced in https://trac.webkit.org/changeset/274603/webkit

In file included from ../../Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:30:
In file included from ../../Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h:30:
In file included from ../../Source/WebCore/platform/graphics\GraphicsContextGL.h:32:
In file included from ../../Source/WebCore/platform/graphics/Image.h:30:
In file included from ../../Source/WebCore/platform/graphics/DecodingOptions.h:28:
In file included from ../../Source/WebCore/platform/graphics\IntSize.h:29:
In file included from WTF/Headers\wtf/JSONValues.h:35:
In file included from WTF/Headers\wtf/HashMap.h:25:
WTF/Headers\wtf/HashTable.h:671:9: error: static_assert failed due to requirement &apos;sizeof(WTF::String) + sizeof(WTF::KeyValuePair&lt;WTF::String, sh::ShaderVariable&gt;) &lt; 250&apos; &quot;Your HashTable types are too big to efficiently move when rehashing.  Consider using UniqueRef instead&quot;
        static_assert(sizeof(Key) + sizeof(Value) &lt; 250, &quot;Your HashTable types are too big to efficiently move when rehashing.  Consider using UniqueRef instead&quot;);
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

....
                  ^
../../Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:301:63: note: in instantiation of member function &apos;WTF::HashMap&lt;WTF::String, sh::ShaderVariable, WTF::DefaultHash&lt;WTF::String&gt;, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTraits&lt;sh::ShaderVariable&gt; &gt;::find&apos; requested here
        const auto&amp; fragmentSymbol = fragmentEntry.varyingMap.find(symbolName);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1743864</commentid>
    <comment_count>1</comment_count>
      <attachid>424267</attachid>
    <who name="Don Olmstead">don.olmstead</who>
    <bug_when>2021-03-25 12:30:00 -0700</bug_when>
    <thetext>Created attachment 424267
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1743865</commentid>
    <comment_count>2</comment_count>
      <attachid>424267</attachid>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2021-03-25 12:30:58 -0700</bug_when>
    <thetext>Comment on attachment 424267
Patch

Unfortunately, this is the most straightforward solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1743892</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-03-25 13:20:52 -0700</bug_when>
    <thetext>Committed r275053: &lt;https://commits.webkit.org/r275053&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 424267.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1743893</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-03-25 13:21:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/75850257&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744671</commentid>
    <comment_count>5</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-03-28 18:58:03 -0700</bug_when>
    <thetext>Out of interest, what makes using a UniqueRef, as the assert suggests should be done here, not feasible?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744742</commentid>
    <comment_count>6</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2021-03-29 09:55:55 -0700</bug_when>
    <thetext>The maps that are hitting this assertion are our use of ShaderSymbolMap.  The value, sh::ShaderVariable, is too big.  Since sh::ShaderVariable isn&apos;t fast allocated, we can&apos;t use UniqueRef or makeUnique as they stand.  Our solutions were either

1. Make sh::ShaderVariable fast allocated which would require ANGLE to use WTF
2. Use makeUniqueRefWithoutFastMallocCheck
3. This, which doesn&apos;t change existing behavior at all.

Given that ports are moving away from !USE(ANGLE), we decided it would be best to just keep the status quo until that happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744752</commentid>
    <comment_count>7</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-03-29 10:08:46 -0700</bug_when>
    <thetext>(In reply to Alex Christensen from comment #6)
&gt; The maps that are hitting this assertion are our use of ShaderSymbolMap. 
&gt; The value, sh::ShaderVariable, is too big.  Since sh::ShaderVariable isn&apos;t
&gt; fast allocated, we can&apos;t use UniqueRef or makeUnique as they stand.  Our
&gt; solutions were either
&gt; 
&gt; 1. Make sh::ShaderVariable fast allocated which would require ANGLE to use
&gt; WTF
&gt; 2. Use makeUniqueRefWithoutFastMallocCheck
&gt; 3. This, which doesn&apos;t change existing behavior at all.
&gt; 
&gt; Given that ports are moving away from !USE(ANGLE), we decided it would be
&gt; best to just keep the status quo until that happens.

I don&apos;t understand why makeUniqueRefWithoutFastMallocCheck wouldn&apos;t be the right answer here. Having !USE(ANGLE) in the middle of HashTable seems like more invasive change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744755</commentid>
    <comment_count>8</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2021-03-29 10:13:20 -0700</bug_when>
    <thetext>True.  makeUniqueRefWithoutFastMallocCheck would be better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744769</commentid>
    <comment_count>9</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2021-03-29 10:38:18 -0700</bug_when>
    <thetext>The best solution is to remove all the !USE(ANGLE) code, but this is just in the interim.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>424267</attachid>
            <date>2021-03-25 12:30:00 -0700</date>
            <delta_ts>2021-03-25 13:20:53 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-223757.diff</filename>
            <type>text/plain</type>
            <size>2288</size>
            <attacher name="Don Olmstead">don.olmstead</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XVEYvQ2hhbmdlTG9nIGIvU291cmNlL1dURi9DaGFuZ2VMb2cK
aW5kZXggZjI5NDBkMzE4NDdmLi4wOWZiOTM1M2M4MGYgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XVEYv
Q2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMjUgQEAKKzIw
MjEtMDMtMjUgIERvbiBPbG1zdGVhZCAgPGR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