Skip to content

Conversation

juj
Copy link
Collaborator

@juj juj commented Jun 15, 2025

No description provided.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

// This test kicks off an asynchronous glutMainLoop(), so do not perform a synchronous
// reftest immediately after falling out from main.
EM_ASM({reftestBlock()});
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change is needed then how/why is this test passing today? I would assume the reftest is triggered by the first swapbuffers or something like that.. but I can't remember now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reftest is triggered in Module'postRun'.

It probably passes because rAF() takes only 16 msecs, and XHRs from disk are likely slower than that, so one or more of rAF()s squeeze in to finish before the XHR completes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps reftest its triggers both by postRun and also by intercepting window.requestAnimationFrame. Perhaps we should have some kind of way to tell the reftest code to wait for RAF instead of also running as part of postRun?

Or perhaps we can/should replace postRun with onExit (which wont' be called when main returns but only when the whole program exits)?

@juj juj enabled auto-merge (squash) August 14, 2025 16:47
@juj juj merged commit fa24df9 into emscripten-core:main Aug 15, 2025
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants