phetsims / natural-selection

"Natural Selection" is an educational simulation in HTML5, by PhET Interactive Simulations
GNU General Public License v3.0
3 stars 7 forks source link

CT: Child bounds mismatch after validateBounds #363

Closed zepumph closed 4 months ago

zepumph commented 6 months ago

This seems to always fail when the preferences dialog is open. Only with assertSlow. @jonathanolson, how do you recommend I debug something like this? Also, have you been in the area while working on locale stuff (since there is a localization panel that it sometimes breaks on.

natural-selection : fuzz : unbuilt : assertSlow
URL: http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/natural-selection/natural-selection_en.html?continuousTest=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22assertSlow%22%5D%2C%22snapshotName%22%3A%22snapshot-1715971205054%22%2C%22timestamp%22%3A1715975212085%7D&brand=phet&eall&fuzz
ERROR: QUERY: brand=phet&eall&fuzz
Uncaught Error: Assertion failed: Child bounds mismatch after validateBounds: [x:(0,186.00000000000003),y:(0,98)], expected: [x:(0,173),y:(0,98)]
STACK: Error: Assertion failed: Child bounds mismatch after validateBounds: [x:(0,186.00000000000003),y:(0,98)], expected: [x:(0,173),y:(0,98)]
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/assert/js/assert.js:42:13)
    at assertSlow (Node.ts:1603:22)
    at  (Node.ts:1612:10)
    at validateBounds (Node.ts:1430:16)
    at validateBounds (Node.ts:1668:18)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1654:17)
    at validateWatchedBounds (Display.ts:569:19)
    at updateDisplay (Sim.ts:452:21)
    at apply (PhetioAction.ts:162:16)
    at execute (Sim.ts:1049:30)
    at stepSimulation (Sim.ts:1039:11)
    at stepOneFrame (Sim.ts:1014:11)
====================
FULL LOG:
[URL] http://128.138.93.172/continuous-testing/aqua/html/sim-test.html?url=..%2F..%2Fct-snapshots%2F1715971205054%2Fnatural-selection%2Fnatural-selection_en.html&simQueryParameters=brand%3Dphet%26eall%26fuzz&testInfo=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22assertSlow%22%5D%2C%22snapshotName%22%3A%22snapshot-1715971205054%22%2C%22timestamp%22%3A1715975212085%7D
[NAVIGATED] http://128.138.93.172/continuous-testing/aqua/html/sim-test.html?url=..%2F..%2Fct-snapshots%2F1715971205054%2Fnatural-selection%2Fnatural-selection_en.html&simQueryParameters=brand%3Dphet%26eall%26fuzz&testInfo=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22assertSlow%22%5D%2C%22snapshotName%22%3A%22snapshot-1715971205054%22%2C%22timestamp%22%3A1715975212085%7D
[ATTACHED] 
[NAVIGATED] about:blank
[NAVIGATED] http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/natural-selection/natural-selection_en.html?continuousTest=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22assertSlow%22%5D%2C%22snapshotName%22%3A%22snapshot-1715971205054%22%2C%22timestamp%22%3A1715975212085%7D&brand=phet&eall&fuzz
[CONSOLE] enabling assert
[CONSOLE] enabling assertSlow
[CONSOLE] continuous-test-load
[CONSOLE] Assertion failed:  Child bounds mismatch after validateBounds: [x:(0,186.00000000000003),y:(0,98)], expected: [x:(0,173),y:(0,98)]
[CONSOLE] Debug info: {
  "seed": 0.6378696018024905,
  "currentScreenName": "LabScreen"
}
[PAGE ERROR] Error: Error: Assertion failed: Child bounds mismatch after validateBounds: [x:(0,186.00000000000003),y:(0,98)], expected: [x:(0,173),y:(0,98)]
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/assert/js/assert.js:42:13)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1394:23
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1396:9)
    at TinyStaticProperty.get (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/axon/js/TinyStaticProperty.js:26:10)
    at TinyStaticProperty.notifyListeners (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/axon/js/TinyStaticProperty.js:49:20)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1353:31)
    at TinyStaticProperty.get (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/axon/js/TinyStaticProperty.js:26:10)
    at TinyStaticProperty.notifyListeners (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/axon/js/TinyStaticProperty.js:49:20)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1263:36)
    at AddMutationsPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at AddMutationsPanel.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1447:19)
    at VBox.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at IntroScreenView.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.validateWatchedBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1433:17)
    at SimDisplay.updateDisplay (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/display/Display.js:359:20)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/joist/js/Sim.js:372:22
    at PhetioAction.execute (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/tandem/js/PhetioAction.js:137:17)
    at Sim.stepSimulation (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/joist/js/Sim.js:885:31)
[CONSOLE] continuous-test-error
[CONSOLE] Assertion failed:  Child bounds mismatch after validateBounds: [x:(0,186.00000000000003),y:(0,98)], expected: [x:(0,173),y:(0,98)]
[CONSOLE] Debug info: {
  "seed": 0.6378696018024905,
  "currentScreenName": "LabScreen"
}
[PAGE ERROR] Error: Error: Assertion failed: Child bounds mismatch after validateBounds: [x:(0,186.00000000000003),y:(0,98)], expected: [x:(0,173),y:(0,98)]
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/assert/js/assert.js:42:13)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1394:23
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1396:9)
    at AddMutationsPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at AddMutationsPanel.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1447:19)
    at VBox.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at IntroScreenView.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.validateWatchedBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/nodes/Node.js:1433:17)
    at SimDisplay.updateDisplay (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/scenery/js/display/Display.js:359:20)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/joist/js/Sim.js:372:22
    at PhetioAction.execute (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/tandem/js/PhetioAction.js:137:17)
    at Sim.stepSimulation (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/joist/js/Sim.js:885:31)
    at Sim.stepOneFrame (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/joist/js/Sim.js:875:12)
    at Sim.runAnimationLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1715971205054/chipper/dist/js/joist/js/Sim.js:853:12)
[CONSOLE] continuous-test-error

id: "Sparky Node Puppeteer"
Snapshot from 5/17/2024, 12:40:05 PM
zepumph commented 6 months ago

Easily reproducible with the following steps:

  1. natural selection with eall
  2. open preferences dialog to the localization tab
  3. First click on the blue highlighted locale
  4. Then clock on the red highlighted locale

image

@jonathanolson @samreid and I found that toggling between these two locales changes from a very long string in the mutations panel, to a less long one.

zepumph commented 6 months ago

This did not fix the bug, but these lines really scare @jonathanolson

Subject: [PATCH] Pass launchButtonEnabledProperty directly to the launchButton.enabledProperty, see https://github.com/phetsims/projectile-data-lab/issues/141
---
Index: js/common/view/NaturalSelectionPanel.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/NaturalSelectionPanel.ts b/js/common/view/NaturalSelectionPanel.ts
--- a/js/common/view/NaturalSelectionPanel.ts   (revision 3f0a6803899c2f1799d2cc97d8265ef5f94c09b3)
+++ b/js/common/view/NaturalSelectionPanel.ts   (date 1715983198290)
@@ -41,8 +41,8 @@
       `invalid fixedWidth: ${options.fixedWidth}` );

     if ( options.fixedWidth ) {
-      options.minWidth = options.fixedWidth;
-      options.maxWidth = options.fixedWidth;
+      // options.minWidth = options.fixedWidth;
+      // options.maxWidth = options.fixedWidth;
     }

     super( content, options );

Next steps are to investigate the assertion code more in depth to understand what case we are in.

pixelzoom commented 6 months ago

This did not fix the bug, but these lines really scare @jonathanolson

-      options.minWidth = options.fixedWidth;
-      options.maxWidth = options.fixedWidth;
+      // options.minWidth = options.fixedWidth;
+      // options.maxWidth = options.fixedWidth;

What's scary about it? This sim predates scenery layout, and that was an approach to creating fixed-width panels that worked just fine. If there's something about scenery layout that no longer supports minWidth === maxWidth, then scenery should complain loudly.

pixelzoom commented 6 months ago

@zepumph I'd be happy to take over this issue. It makes me sad to see Natural Selection failing CT.

If the problem is indeed caused by the "scary" (whatever that means) minWidth === maxWidth, then it should be straighforward to replace that will new scenery layout. I've replaced the same in Gas Properties recently. But it's not clear to me from the above comments what (or where) the problem actually is.

Let's talk.

zepumph commented 6 months ago

I looked again today for a few minutes but again couldn't find the issue. I'm unsure what the cause is. Help would be appreciated! I'm on Vacation until next Friday.

pixelzoom commented 6 months ago

Reproduced in my working copy with http://localhost:8080/natural-selection/natural-selection_en.html?brand=phet&eall&fuzz

pixelzoom commented 6 months ago

@jonathanolson Could you please comment on:

(1) Why is minWidth === maxWidth "scary"? As noted in https://github.com/phetsims/natural-selection/issues/363#issuecomment-2118431933.

(2) What do you think the problem is here?

(3) How should the problem be fixed?

jonathanolson commented 6 months ago

(1) Why is minWidth === maxWidth "scary"?

I've encountered many infinite loop issues with using maxWidth (and how it interacts with just about everything). Compound this with the numerical case of "if maxWidth sets a scale where there is floating point error such that the width is slightly smaller, THEN it would get resized by minWidth on something and ping-ping" (since minWidth/maxWidth currently don't have epsilons in comparisons). So it's essentially implicitly going to blow up if the width/scale has any floating point imprecision.

(2) (3)

I did not do a dive into this. I think I noted that we're probably having a weird re-entrant case not properly handled by the assertions. It may be a case where we examine validateBounds() and say we can relax assertions.

I would probably refactor code to avoid minWidth+maxWidth combo (even if it is a listener that rescales).

If we are leaving sim code alone, I would first start with tracing back all potential re-entrant cases in validateBounds() that could cause this to occur, and work out the logic. It seems likely we're getting significant reentrancy in updateMaxDimension => Panel layout on min.

pixelzoom commented 6 months ago

Thanks @jonathanolson. I'll start by replacing the "minWidth+maxWidth combo", as I did recently in Gas Properties.

pixelzoom commented 6 months ago

Before making any changes to natural-selection, I published 1.6.0-dev.2, so I can compare before/after layout.

Here's the general approach to fixed width panels that @jonathanolson recommended previously for gas-properties. For example in IdealScreenView.ts:

const PANEL_WIDTH = 225;
...
    const vBox = new VBox( {
      children: panels,
...
      // All panels have the same fixed width.
      stretch: true,
      minContentWidth: PANEL_WIDTH,
      maxWidth: PANEL_WIDTH
    } );
pixelzoom commented 6 months ago

In the above commits, I replaced the "minWidth+maxWidth combo" with scenery layout to implement fixed-width panels. Testing with ?stringTest=dynamic, I verified that the layout is unchanged. This feels like a nice update, glad that I did it.

But testing with http://localhost:8080/natural-selection/natural-selection_en.html?brand=phet&eall&fuzz, I'm still hitting a "Child bounds mismatch after validateBounds" error, and the "Debug info" indicates the problem is related to PreferencesDialog -- see below. Also seeing this on CT. Natural Selection has no sim-specific preferences, so this feels like a general problem.

I don't know how to proceed with debugging this. @jonathanolson what do you recommend?


assert.js:24 Assertion failed:  Child bounds mismatch after validateBounds: [x:(0,185.99999999999994),y:(0,96)], expected: [x:(0,185.83398437499994),y:(0,96)]
window.assertions.assertFunction @ assert.js:24
(anonymous) @ Node.ts:1603
validateBounds @ Node.ts:1612
get @ TinyStaticProperty.ts:31
notifyListeners @ TinyStaticProperty.ts:56
validateBounds @ Node.ts:1455
validateBounds @ Node.ts:1430
get @ TinyStaticProperty.ts:31
get value @ TinyProperty.ts:61
getBounds @ Node.ts:2026
get bounds @ Node.ts:2033
get bounds @ LayoutProxy.ts:71
(anonymous) @ NodeLayoutConstraint.ts:101
filterLayoutCells @ NodeLayoutConstraint.ts:100
layout @ FlowConstraint.ts:128
updateLayout @ LayoutConstraint.ts:201
updateLayoutAutomatically @ LayoutConstraint.ts:215
notifyLoop @ TinyEmitter.ts:213
emit @ TinyEmitter.ts:185
notifyListeners @ TinyProperty.ts:125
set @ TinyProperty.ts:85
set value @ TinyProperty.ts:68
_updateMinimumHeight @ HeightSizable.ts:387
notifyLoop @ TinyEmitter.ts:213
emit @ TinyEmitter.ts:185
notifyListeners @ TinyProperty.ts:125
set @ TinyProperty.ts:85
set value @ TinyProperty.ts:68
set localMinimumHeight @ HeightSizable.ts:216
layout @ Panel.ts:258
updateLayout @ LayoutConstraint.ts:201
updateLayoutAutomatically @ LayoutConstraint.ts:215
notifyLoop @ TinyEmitter.ts:213
emit @ TinyEmitter.ts:185
notifyListeners @ TinyProperty.ts:125
set @ TinyProperty.ts:85
set value @ TinyProperty.ts:68
_updateMinimumHeight @ HeightSizable.ts:387
notifyLoop @ TinyEmitter.ts:213
emit @ TinyEmitter.ts:185
notifyListeners @ TinyProperty.ts:125
set @ TinyProperty.ts:85
set value @ TinyProperty.ts:68
layout @ FlowConstraint.ts:343
updateLayout @ LayoutConstraint.ts:201
updateLayoutAutomatically @ LayoutConstraint.ts:215
notifyLoop @ TinyEmitter.ts:213
emit @ TinyEmitter.ts:185
notifyListeners @ TinyStaticProperty.ts:56
validateBounds @ Node.ts:1556
get @ TinyStaticProperty.ts:31
notifyListeners @ TinyStaticProperty.ts:56
validateBounds @ Node.ts:1502
validateBounds @ Node.ts:1430
validateBounds @ Node.ts:1430
validateBounds @ Node.ts:1430
watchedBoundsScan @ Node.ts:1668
watchedBoundsScan @ Node.ts:1675
watchedBoundsScan @ Node.ts:1675
watchedBoundsScan @ Node.ts:1675
validateWatchedBounds @ Node.ts:1654
updateDisplay @ Display.ts:569
(anonymous) @ Sim.ts:453
execute @ PhetioAction.ts:162
stepSimulation @ Sim.ts:1050
stepOneFrame @ Sim.ts:1040
runAnimationLoop @ Sim.ts:1015
requestAnimationFrame (async)
...
assert.js:27 Debug info: {
  "seed": 0.42370539824137965,
  "currentScreenName": "LabScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
KatieWoe commented 6 months ago

May be related:

natural-selection : fuzz : unbuilt : listenerOrderRandom
URL: http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/natural-selection/natural-selection_en.html?continuousTest=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22listenerOrderRandom%22%5D%2C%22snapshotName%22%3A%22snapshot-1717060719199%22%2C%22timestamp%22%3A1717065176108%7D&brand=phet&ea&fuzz&listenerOrder=random
ERROR: QUERY: brand=phet&ea&fuzz&listenerOrder=random
Uncaught Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
STACK: Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/assert/js/assert.js:43:13)
    at assert (Node.ts:2906:14)
    at auditMaxDimensions (Node.ts:2873:19)
    at updateMaxDimension (Node.ts:1493:13)
    at validateBounds (Node.ts:1430:16)
    at validateBounds (Node.ts:1668:18)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1654:17)
    at validateWatchedBounds (Display.ts:569:19)
    at updateDisplay (Sim.ts:453:21)
    at apply (PhetioAction.ts:162:16)
    at execute (Sim.ts:1050:30)
    at stepSimulation (Sim.ts:1040:11)
    at stepOneFrame (Sim.ts:1015:11)
====================
FULL LOG:
[URL] http://128.138.93.172/continuous-testing/aqua/html/sim-test.html?url=..%2F..%2Fct-snapshots%2F1717060719199%2Fnatural-selection%2Fnatural-selection_en.html&simQueryParameters=brand%3Dphet%26ea%26fuzz%26listenerOrder%3Drandom&testInfo=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22listenerOrderRandom%22%5D%2C%22snapshotName%22%3A%22snapshot-1717060719199%22%2C%22timestamp%22%3A1717065176108%7D
[NAVIGATED] http://128.138.93.172/continuous-testing/aqua/html/sim-test.html?url=..%2F..%2Fct-snapshots%2F1717060719199%2Fnatural-selection%2Fnatural-selection_en.html&simQueryParameters=brand%3Dphet%26ea%26fuzz%26listenerOrder%3Drandom&testInfo=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22listenerOrderRandom%22%5D%2C%22snapshotName%22%3A%22snapshot-1717060719199%22%2C%22timestamp%22%3A1717065176108%7D
[ATTACHED] 
[NAVIGATED] about:blank
[NAVIGATED] http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/natural-selection/natural-selection_en.html?continuousTest=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22listenerOrderRandom%22%5D%2C%22snapshotName%22%3A%22snapshot-1717060719199%22%2C%22timestamp%22%3A1717065176108%7D&brand=phet&ea&fuzz&listenerOrder=random
[CONSOLE] enabling assert
[CONSOLE] listenerOrder random seed: 955455
[CONSOLE] continuous-test-load
[CONSOLE] Assertion failed:  If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
[CONSOLE] Debug info: {
  "seed": 0.03304810301674421,
  "currentScreenName": "LabScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
[PAGE ERROR] Error: Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/assert/js/assert.js:43:13)
    at VBox.auditMaxDimensions (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2635:15)
    at VBox._updateLocalPreferredHeight (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/layout/HeightSizable.js:154:22)
    at TinyProperty.notifyLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyEmitter.js:176:7)
    at TinyProperty.emit (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyEmitter.js:154:18)
    at TinyProperty.notifyListeners (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyProperty.js:110:10)
    at TinyProperty.set (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyProperty.js:70:12)
    at set value [as value] (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyProperty.js:56:10)
    at set preferredWidth [as preferredWidth] (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/layout/WidthSizable.js:91:41)
    at PanelConstraint.layout (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/sun/js/Panel.js:166:30)
    at PanelConstraint.updateLayout (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/layout/constraints/LayoutConstraint.js:188:14)
    at PanelConstraint.updateLayoutAutomatically (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/layout/constraints/LayoutConstraint.js:201:12)
    at TinyProperty.notifyLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyEmitter.js:176:7)
    at TinyProperty.emit (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyEmitter.js:154:18)
    at TinyProperty.notifyListeners (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyProperty.js:110:10)
    at TinyProperty.set (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyProperty.js:70:12)
    at set value [as value] (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyProperty.js:56:10)
    at VBox._updateMinimumHeight (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/layout/HeightSizable.js:247:46)
    at TinyEmitter.notifyLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyEmitter.js:176:7)
    at TinyEmitter.emit (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/axon/js/TinyEmitter.js:161:14)
[CONSOLE] continuous-test-error
[CONSOLE] Assertion failed:  If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
[CONSOLE] Debug info: {
  "seed": 0.03304810301674421,
  "currentScreenName": "LabScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
[PAGE ERROR] Error: Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/assert/js/assert.js:43:13)
    at VBox.auditMaxDimensions (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2635:15)
    at VBox.updateMaxDimension (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2607:20)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1297:14)
    at AllelesPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at AllelesPanel.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1447:19)
    at PedigreeNode.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at LabScreenView.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.validateWatchedBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1433:17)
    at SimDisplay.updateDisplay (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/display/Display.js:359:20)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:372:22
    at PhetioAction.execute (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/tandem/js/PhetioAction.js:137:17)
    at Sim.stepSimulation (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:885:31)
    at Sim.stepOneFrame (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:875:12)
    at Sim.runAnimationLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:853:12)
[CONSOLE] continuous-test-error
[CONSOLE] Assertion failed:  If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
[CONSOLE] Debug info: {
  "seed": 0.03304810301674421,
  "currentScreenName": "LabScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
[PAGE ERROR] Error: Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/assert/js/assert.js:43:13)
    at VBox.auditMaxDimensions (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2635:15)
    at VBox.updateMaxDimension (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2607:20)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1297:14)
    at AllelesPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at AllelesPanel.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1447:19)
    at PedigreeNode.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at LabScreenView.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.validateWatchedBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1433:17)
    at SimDisplay.updateDisplay (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/display/Display.js:359:20)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:372:22
    at PhetioAction.execute (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/tandem/js/PhetioAction.js:137:17)
    at Sim.stepSimulation (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:885:31)
    at Sim.stepOneFrame (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:875:12)
    at Sim.runAnimationLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:853:12)
[CONSOLE] continuous-test-error
[CONSOLE] Assertion failed:  If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
[CONSOLE] Debug info: {
  "seed": 0.03304810301674421,
  "currentScreenName": "LabScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
[PAGE ERROR] Error: Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/assert/js/assert.js:43:13)
    at VBox.auditMaxDimensions (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2635:15)
    at VBox.updateMaxDimension (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2607:20)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1297:14)
    at AllelesPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at AllelesPanel.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1447:19)
    at PedigreeNode.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at LabScreenView.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.validateWatchedBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1433:17)
    at SimDisplay.updateDisplay (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/display/Display.js:359:20)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:372:22
    at PhetioAction.execute (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/tandem/js/PhetioAction.js:137:17)
    at Sim.stepSimulation (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:885:31)
    at Sim.stepOneFrame (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:875:12)
    at Sim.runAnimationLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:853:12)
[CONSOLE] continuous-test-error
[CONSOLE] Assertion failed:  If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
[CONSOLE] Debug info: {
  "seed": 0.03304810301674421,
  "currentScreenName": "LabScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
[PAGE ERROR] Error: Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/assert/js/assert.js:43:13)
    at VBox.auditMaxDimensions (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2635:15)
    at VBox.updateMaxDimension (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2607:20)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1297:14)
    at AllelesPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at AllelesPanel.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1447:19)
    at PedigreeNode.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at LabScreenView.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.validateWatchedBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1433:17)
    at SimDisplay.updateDisplay (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/display/Display.js:359:20)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:372:22
    at PhetioAction.execute (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/tandem/js/PhetioAction.js:137:17)
    at Sim.stepSimulation (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:885:31)
    at Sim.stepOneFrame (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:875:12)
    at Sim.runAnimationLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:853:12)
[CONSOLE] continuous-test-error
[CONSOLE] Assertion failed:  If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
[CONSOLE] Debug info: {
  "seed": 0.03304810301674421,
  "currentScreenName": "LabScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
[PAGE ERROR] Error: Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/assert/js/assert.js:43:13)
    at VBox.auditMaxDimensions (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2635:15)
    at VBox.updateMaxDimension (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:2607:20)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1297:14)
    at AllelesPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at AllelesPanel.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1447:19)
    at PedigreeNode.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at LabScreenView.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.validateWatchedBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/nodes/Node.js:1433:17)
    at SimDisplay.updateDisplay (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/scenery/js/display/Display.js:359:20)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:372:22
    at PhetioAction.execute (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/tandem/js/PhetioAction.js:137:17)
    at Sim.stepSimulation (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:885:31)
    at Sim.stepOneFrame (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:875:12)
    at Sim.runAnimationLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1717060719199/chipper/dist/js/joist/js/Sim.js:853:12)
[CONSOLE] continuous-test-error
[CONSOLE] Assertion failed:  If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop
[CONSOLE] Debug info: {
  "seed": 0.03304810301674421,
  "currentScreenName": "LabScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
zepumph commented 5 months ago

I can fix the bug if the child bounds are marked dirty for the content of the addMutationsPanel.

```diff Subject: [PATCH] add to binder, https://github.com/phetsims/sun/issues/885 --- Index: natural-selection/js/common/view/AddMutationsPanel.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/natural-selection/js/common/view/AddMutationsPanel.ts b/natural-selection/js/common/view/AddMutationsPanel.ts --- a/natural-selection/js/common/view/AddMutationsPanel.ts (revision 822f83e4b3de1d3834e278f33f895ed0599b5bcb) +++ b/natural-selection/js/common/view/AddMutationsPanel.ts (date 1717703611964) @@ -112,6 +112,7 @@ spacing: 2, children: [ titleText, columnHeadingsNode, vBox ] } ) ); + content.hi = true; super( content, options ); Index: scenery/js/nodes/Node.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/scenery/js/nodes/Node.ts b/scenery/js/nodes/Node.ts --- a/scenery/js/nodes/Node.ts (revision 49a4e25f8cc90104745d10ef87b1c1fb7a8e1612) +++ b/scenery/js/nodes/Node.ts (date 1717703734718) @@ -1400,6 +1400,9 @@ */ public validateBounds(): boolean { + if ( this.hi ) { + this._childBoundsDirty = true; + } sceneryLog && sceneryLog.bounds && sceneryLog.bounds( `validateBounds #${this._id}` ); sceneryLog && sceneryLog.bounds && sceneryLog.push(); ```

@jonathanolson, I believe I have investigated as much as possible. Perhaps there is something in regards to the locale change that isn't marking the child dirty? I don't think it is worth investigating more on my own, but I'm happy to pair with you if you'd prefer. It is also hard for me to imagine that my recent changes to this sim caused this issue. But I also don't really understand what else could have caused it. @jonathanolson have you made any locale specific changes regarding those texts that this may change?

pixelzoom commented 5 months ago

This sim has been broken far too long, and I've been waiting for a reply from @jonathanolson since 5/23/2024. How do you recommend that we proceed with clearing up this problem?

This problem has now morphed into the following error, as noted by @KatieWoe in https://github.com/phetsims/natural-selection/issues/363#issuecomment-2139971069:

Uncaught Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop

This assertion was added by @jonathanolson in https://github.com/phetsims/scenery/commit/6c7bbb62b0f779323d84f80868030a14c4f7d8c6 on 9/20/22, so it's not something new.

This sim is not explicitly setting preferredWidth anywhere, so I'm guessing that something changed in scenery layout to fail the assertion.

The error occurs very quickly and relibably when running with ?brand=phet&ea&fuzz&listenerOrder=random. It does NOT occur if listenerOrder is omitted.

pixelzoom commented 5 months ago

Digging through the stack trace, this is only place where I can find a phetioID:

> this.phetioID
'naturalSelection.labScreen.view.graphs.pedigreeNode.allelesPanel.teethRow'
screenshot_3380
pixelzoom commented 5 months ago

To reproduce without fuzzing, run http://localhost:8080/natural-selection/natural-selection_en.html?brand=phet&ea&listenerOrder=random, then follow these steps:

  1. Go to the Lab screen
  2. Open Preferences > Localization
  3. Select "Català"
  4. Select "chiShona". The assertion failure occurs.

The failure is NOT always related to teethRow. The stack trace at _updateMinimumWidth WidthSizable.ts:386 identifies different values of this.phetioID depending on which 2 locales are selected. For example:

"Català" (ca) then "chiShona" (sn) -> teethRow "Turkmen" (tk) then "Qhichwa" (qu) -> teethRow "latviešu valoda" (lv) then "isiXhosa" (xh) -> teethRow "Hausa" (ha) then "isiZulu" (zu) -> furRow

Note that for the locales in these examples, there is no babel translation file for sn, qu, xh -- the failures occurring in teethRow.

pixelzoom commented 5 months ago

Reminder that the error is:

Uncaught Error: Assertion failed: If maxWidth and preferredWidth are both non-null, maxWidth should NOT be smaller than the preferredWidth. If that happens, it would trigger an infinite loop

My hypothesis: maxWidth and preferredWidth are adjusted by scenery layout when switching locales. With listenerOrder=random, the order of adjustment changes, putting things in an intermediate state when the assertion fails. @jonathanolson does that sound like a possibility?

pixelzoom commented 5 months ago

Running with allelesVisible=false (a sim-specific query parameter) causes the problem to go away. And this bit of code in PedigreeNode.ts seems to be responsible:

     const graphWidth = NaturalSelectionQueryParameters.allelesVisible ?
                       size.width - controlPanelWidth - options.spacing :
                       size.width;

The change in this patch resolves the error. So setting maxHeight is apparently affecting maxWidth and/or preferredWidth?

Subject: [PATCH] clean up listener callback formatting
---
Index: js/common/view/pedigree/PedigreeNode.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/pedigree/PedigreeNode.ts b/js/common/view/pedigree/PedigreeNode.ts
--- a/js/common/view/pedigree/PedigreeNode.ts   (revision 822f83e4b3de1d3834e278f33f895ed0599b5bcb)
+++ b/js/common/view/pedigree/PedigreeNode.ts   (date 1718819386487)
@@ -60,7 +60,7 @@
     const allelesPanel = new AllelesPanel( genePool, pedigreeModel.furAllelesVisibleProperty,
       pedigreeModel.earsAllelesVisibleProperty, pedigreeModel.teethAllelesVisibleProperty, {
         fixedWidth: controlPanelWidth,
-        maxHeight: size.height,
+        // maxHeight: size.height,
         tandem: options.tandem.createTandem( 'allelesPanel' )
       } );

Note that AllelesPanel.ts sets minContentWidth and maxWidth for its content:

    const contentWidth = options.fixedWidth - 2 * options.xMargin;
    const content = new VBox( combineOptions<VBoxOptions>( {}, NaturalSelectionConstants.VBOX_OPTIONS, {
      spacing: 28,
      children: [ titleText, ...rows ],
      stretch: true,
      minContentWidth: contentWidth,
      maxWidth: contentWidth
    } ) );
pixelzoom commented 5 months ago

Slack DM (@jonathanolson @zepumph @pixelzoom)

@jonathanolson In looking into https://github.com/phetsims/natural-selection/issues/363, my gut instinct is to set hasListenerOrderDependencies to true for the bounds properties (or whatever scenery-based properties seem to be having their listeners reordered), since that code existed before we created the randomized listener order. Thoughts/objections? (Looks like TinyStaticProperty would need to have some constructor work on it to pass that through)

@pixelzoom You’re referring to the bounds Properties in Node?

@jonathanolson yes

@pixelzoom Unfortunate, but if that’s what needs to be done…

Also wondering why natural-selection is the only sim hitting this. Thoughts?

@jonathanolson Not required, but it seems like it will be a deeper dive to reimplement/adjust core Scenery stuff to work with random listener order. Could have that be one of the major tasks to do if it's important

I haven't identified exactly why it is the only sim hitting this. The maxHeight on a layout container with a maxWidth'ed item might be the reason. I'll take a bit more time investigating

@jonathanolson It looks like it is more specific to the maxWidth set on the content VBox in AllelesPanel is it possible to get rid of that maxWidth?

@pixelzoom

minContentWidth: contentWidth,
maxWidth: contentWidth

… is the approach you recommended for implementing fixed-width panels, which are required in this sim.

pixelzoom commented 5 months ago

More Slack:

@zepumph: maybe using preferredWidth instead?

Thanks @mjkauzmann preferredWidth avoids the problem and still appears to result in a fixed-width panel, so I’ve changed to that. I don’t like the fact that the recommended approach (minContentWidth + maxWidth) does not work in this case, and I suspect that it will come back to bite us. But since I’ve spent way too much time on this issue, I’ll just put a note in the code and close the issue.

Please add further comments in the issue, https://github.com/phetsims/natural-selection/issues/363.

pixelzoom commented 4 months ago

Reopening. After resolving the "maxWidth should NOT be smaller than the preferredWidth" error with the workaround suggested by @zepumph, we're back to back to the original error: "Child bounds mismatch after validateBounds".

This sim has been broken in CT since May 17, and it's reated to scenery layout. @jonathanolson could you please have a look?

natural-selection : fuzz : unbuilt : assertSlow
URL: http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/natural-selection/natural-selection_en.html?continuousTest=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22assertSlow%22%5D%2C%22snapshotName%22%3A%22snapshot-1720276110314%22%2C%22timestamp%22%3A1720278334161%7D&brand=phet&eall&fuzz
ERROR: QUERY: brand=phet&eall&fuzz
Uncaught Error: Assertion failed: Child bounds mismatch after validateBounds: [x:(0,186),y:(0,195)], expected: [x:(0,180),y:(0,195)]
STACK: Error: Assertion failed: Child bounds mismatch after validateBounds: [x:(0,186),y:(0,195)], expected: [x:(0,180),y:(0,195)]
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/assert/js/assert.js:45:13)
    at assertSlow (Node.ts:1603:22)
    at  (Node.ts:1612:10)
    at validateBounds (Node.ts:1430:16)
    at validateBounds (Node.ts:1430:16)
    at validateBounds (Node.ts:1668:18)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1675:38)
    at watchedBoundsScan (Node.ts:1654:17)
    at validateWatchedBounds (Display.ts:569:19)
    at updateDisplay (Sim.ts:458:21)
    at apply (PhetioAction.ts:162:16)
    at execute (Sim.ts:1055:30)
    at stepSimulation (Sim.ts:1045:11)
    at stepOneFrame (Sim.ts:1020:11)
====================
FULL LOG:
[URL] http://128.138.93.172/continuous-testing/aqua/html/sim-test.html?url=..%2F..%2Fct-snapshots%2F1720276110314%2Fnatural-selection%2Fnatural-selection_en.html&simQueryParameters=brand%3Dphet%26eall%26fuzz&testInfo=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22assertSlow%22%5D%2C%22snapshotName%22%3A%22snapshot-1720276110314%22%2C%22timestamp%22%3A1720278334161%7D
[NAVIGATED] http://128.138.93.172/continuous-testing/aqua/html/sim-test.html?url=..%2F..%2Fct-snapshots%2F1720276110314%2Fnatural-selection%2Fnatural-selection_en.html&simQueryParameters=brand%3Dphet%26eall%26fuzz&testInfo=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22assertSlow%22%5D%2C%22snapshotName%22%3A%22snapshot-1720276110314%22%2C%22timestamp%22%3A1720278334161%7D
[ATTACHED] 
[NAVIGATED] about:blank
[NAVIGATED] http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/natural-selection/natural-selection_en.html?continuousTest=%7B%22test%22%3A%5B%22natural-selection%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22assertSlow%22%5D%2C%22snapshotName%22%3A%22snapshot-1720276110314%22%2C%22timestamp%22%3A1720278334161%7D&brand=phet&eall&fuzz
[CONSOLE] enabling assert
[CONSOLE] enabling assertSlow
[CONSOLE] continuous-test-load
[CONSOLE] Assertion failed:  Child bounds mismatch after validateBounds: [x:(0,186),y:(0,98)], expected: [x:(0,173),y:(0,98)]
[CONSOLE] Debug info: {
  "seed": 0.46019073882472394,
  "currentScreenName": "IntroScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
[PAGE ERROR] Error: Error: Assertion failed: Child bounds mismatch after validateBounds: [x:(0,186),y:(0,98)], expected: [x:(0,173),y:(0,98)]
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/assert/js/assert.js:45:13)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1394:23
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1396:9)
    at TinyStaticProperty.get (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyStaticProperty.js:26:10)
    at TinyStaticProperty.notifyListeners (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyStaticProperty.js:49:20)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1263:36)
    at AddMutationsPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at TinyStaticProperty.get (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyStaticProperty.js:26:10)
    at get value [as value] (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyProperty.js:49:17)
    at FlowConstraint.updateSeparatorVisibility (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/constraints/FlowConstraint.js:52:64)
    at FlowConstraint.layout (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/constraints/FlowConstraint.js:78:10)
    at FlowConstraint.updateLayout (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/constraints/LayoutConstraint.js:188:14)
    at FlowConstraint.updateLayoutAutomatically (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/constraints/LayoutConstraint.js:201:12)
    at TinyProperty.notifyLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyEmitter.js:176:7)
    at TinyProperty.emit (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyEmitter.js:154:18)
    at TinyProperty.notifyListeners (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyProperty.js:110:10)
    at TinyProperty.set (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyProperty.js:70:12)
    at set value [as value] (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyProperty.js:56:10)
    at EnvironmentalFactorsPanel._updateMinimumHeight (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/HeightSizable.js:247:46)
    at TinyProperty.notifyLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyEmitter.js:176:7)
[CONSOLE] continuous-test-error
[CONSOLE] Assertion failed:  Child bounds mismatch after validateBounds: [x:(0,186),y:(0,195)], expected: [x:(0,180),y:(0,195)]
[CONSOLE] Debug info: {
  "seed": 0.46019073882472394,
  "currentScreenName": "IntroScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
[PAGE ERROR] Error: Error: Assertion failed: Child bounds mismatch after validateBounds: [x:(0,186),y:(0,195)], expected: [x:(0,180),y:(0,195)]
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/assert/js/assert.js:45:13)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1394:23
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1396:9)
    at TinyStaticProperty.get (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyStaticProperty.js:26:10)
    at TinyStaticProperty.notifyListeners (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyStaticProperty.js:49:20)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1263:36)
    at AddMutationsPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at TinyStaticProperty.get (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyStaticProperty.js:26:10)
    at get value [as value] (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyProperty.js:49:17)
    at FlowConstraint.updateSeparatorVisibility (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/constraints/FlowConstraint.js:52:64)
    at FlowConstraint.layout (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/constraints/FlowConstraint.js:78:10)
    at FlowConstraint.updateLayout (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/constraints/LayoutConstraint.js:188:14)
    at FlowConstraint.updateLayoutAutomatically (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/constraints/LayoutConstraint.js:201:12)
    at TinyProperty.notifyLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyEmitter.js:176:7)
    at TinyProperty.emit (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyEmitter.js:154:18)
    at TinyProperty.notifyListeners (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyProperty.js:110:10)
    at TinyProperty.set (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyProperty.js:70:12)
    at set value [as value] (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyProperty.js:56:10)
    at EnvironmentalFactorsPanel._updateMinimumHeight (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/layout/HeightSizable.js:247:46)
    at TinyProperty.notifyLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/axon/js/TinyEmitter.js:176:7)
[CONSOLE] continuous-test-error
[CONSOLE] Assertion failed:  Child bounds mismatch after validateBounds: [x:(0,186),y:(0,195)], expected: [x:(0,180),y:(0,195)]
[CONSOLE] Debug info: {
  "seed": 0.46019073882472394,
  "currentScreenName": "IntroScreen",
  "simTopLayer": [
    "BarrierRectangle",
    "PopupParentNode: PreferencesDialog"
  ]
}
[PAGE ERROR] Error: Error: Assertion failed: Child bounds mismatch after validateBounds: [x:(0,186),y:(0,195)], expected: [x:(0,180),y:(0,195)]
    at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/assert/js/assert.js:45:13)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1394:23
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1396:9)
    at AddMutationsPanel.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at VBox.validateBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1239:17)
    at VBox.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1447:19)
    at LabScreenView.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.watchedBoundsScan (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1453:37)
    at Node.validateWatchedBounds (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/nodes/Node.js:1433:17)
    at SimDisplay.updateDisplay (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/scenery/js/display/Display.js:359:20)
    at http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/joist/js/Sim.js:377:22
    at PhetioAction.execute (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/tandem/js/PhetioAction.js:137:17)
    at Sim.stepSimulation (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/joist/js/Sim.js:890:31)
    at Sim.stepOneFrame (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/joist/js/Sim.js:880:12)
    at Sim.runAnimationLoop (http://128.138.93.172/continuous-testing/ct-snapshots/1720276110314/chipper/dist/js/joist/js/Sim.js:858:12)
[CONSOLE] continuous-test-error

id: "Sparky Node Puppeteer"
Snapshot from 7/6/2024, 8:28:30 AM
pixelzoom commented 4 months ago

This now blocks https://github.com/phetsims/natural-selection/issues/364, so assigning @kathy-phet and @brent-phet.

jonathanolson commented 4 months ago

I believe the above change in logic should make the warning go away. @pixelzoom can you verify?

pixelzoom commented 4 months ago

I verified that the sim is no longer failing CT.