-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnecessary memory use in some tests causes false failures on constrained hardware #3328
Comments
Thanks for the report! For tail-call optimization, Test262 maintains a special value called Test262 could take a similar approach here by offering a value like But your point about conformance testing is well-taken. Unlike the TCO tests, the pattern you've identified isn't related to any specific normative text. The circumstances which motivate the use of a "large" array are at least partly implementation-specific. That would make the decision to apply |
@jugglinmike I like this solution. |
@rwaldron Thanks! Do you mean introducing |
Oh, I thought it was two parts of a whole, but I see now that I misinterpreted that. I think we should introduce |
@jugglinmike - thank you for your detailed response like the idea of parameterizing the array length so the relevant tests can easily be tuned as needed. I'll work on generating a list of tests where would help with XS. |
The XS JavaScript engine is designed to run on resource constrained embedded hardware. It runs EcmaScript 2021 on devices with as little as 16 KB of RAM.
We have typically run Test262 against XS running on a computer where there is no practical limit on the memory available to the tests. We have slowly been working on running Test2652 on embedded devices as well. Our current focus is the ESP32 where the default VM size we test with is 64 KB. Our hope is to eventually run Test262 on devices with less memory, so this is a first step.
As expected, some tests fail because of memory exhaustion. That's probably inevitable for some tests. But, there are tests which would pass if they required less memory. A good example is this test
Array.prototoype.copyWithin
:test262/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-end-detached-prototype.js
Lines 34 to 40 in 9f2814f
Here the 10,000 element array causes an allocation failure of the TypedArray on ESP32 which prevents the test from completing. Reducing this to 1000 allows the test to pass. The larger array size does not appear to contribute to validating conformance with the standard. It would be beneficial for developers using XS to know that it implements the correct behavior, so we'd like tests like this to pass.
There are several possible ways to resolve this -- changing the test for all execution environments, adding some kind of configuration test, etc. Before diving into that, I wanted to see if test262 is open to addressing issues like these that impact the use of test262 to validate JavaScript on constrained device targets.
The text was updated successfully, but these errors were encountered: