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
Library bytecode verification unittests #1505
Conversation
1179a94
to
bdf71d1
Compare
@curtisman @MikeHolman @ianwjhalliday please review |
V1.value = 0; | ||
V2.value = 0; | ||
V3.value = 0; | ||
V4.value = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For releases, we need to make sure we have the GUIDs in the ByteCode so that ReleaseVersioningScheme can be applied. In that scenario, can we also ensure consistent bytecode between Chakra and ChakraCore.dll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, I understand now. For library code, we don't want to do the GUID check? We still need to make sure the ByteCode is updated when it is supposed to be. How else can we specifically test this?
In reply to: 76506572 [](ancestors = 76506572)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the library code it doesn't really matter, as long as the unit tests catch the incorrectness. We usually catch this in unit tests when we fail unit tests, but we don't always catch them right now. E.g. the jshost/ch inconsistency fixed in this change. The unit tests are guaranteed to catch the bytecode changes.
Oops thanks for the catch. |
<test> | ||
<default> | ||
<tags>exclude_dynapogo,exclude_amd64,exclude_arm,require_backend</tags> | ||
<compile-flags>-GenerateLibraryByteCodeHeader</compile-flags> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-GenerateLibraryByteCodeHeader [](start = 6, length = 61)
So the plan is to use a test to generate the entire bytecode and check for differences, and then alert the user to the fact that the bytecode needs to be updated?
Since we've already got the binaries handy, this is a good approach.
I think right now the way we regen bytecode depends on scripts. Since we're talking about eventually replacing rl.exe anyway, I don't want to suggest that we put that functionality into rl.exe, but we should define a unified way to generate bytecode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to use scripts in SD but never ported it over to git. There essentially doesn't need to be a script; it was doing what RL does. The only real change is that instead of writing to a file I write to stdout.
Looks like Jenkins is having trouble with release and crossplat. I'll investigate next week. |
@tcare |
<default> | ||
<tags>exclude_dynapogo,exclude_amd64,exclude_arm,require_backend</tags> | ||
<compile-flags>-GenerateLibraryByteCodeHeader</compile-flags> | ||
<files>%REGRESS%\..\lib\Runtime\Library\InJavascript\Intl.js</files> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%REGRESS% [](start = 13, length = 9)
I think paths are relative to the test location so you can just use ..\..\lib\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for using jshost to test core with existing scripts. I'll see if I can work around it..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Simplest solution is to make testrunner.py support %VAR%
Closing for now until cross plat is resolved. |
@tcare Why not keep it open to track it (do we think this will take a long time to resolve?) |
It'll be considerably different. I want to move away from %REGRESS%. Ideally I would move away from RL too ;) |
Reintroduces bytecode verification unittests for library code. We previously had this check in SD days, but it was complicated and called external scripts to work. The new version uses just RL to compare against the header file directly. A number of changes had to be made: - Removed non-standard %REGRESS% psuedo environment variable. Instead, test files and baselines are relative paths based on the directory containing the rlexe.xml. - Fixed the relative path behavior of runtests.py. Also added a guard to the timezone set so runtests.py works on Windows again. - Fixed an issue where ch would generate different bytecode than jshost due to an implicit fscrNoAsmJs parser flag in ScriptContext. We don't need this flag on the initial entry, so it can be removed from the JSRT entrypoint for library bytecode generation. - Disabled using the release version for serialized library bytecode, instead using a fixed version (all 0's). This is OK as long as we check the bytecode integrity in unit tests. - Added an implicit disable_jit tag exclusion when not running disable JIT; this allows us to run some test only under disable JIT and not normally. - Added a new bytecode directory with the xml for the tests. Due to the changes to serialization all of the library bytecode headers needed to be changed.
Reopened. %REGRESS% is gone. We now use the test folder as the working path. @jianchun can you please review the runtests.py changes? |
Looks like runtests.py needs more work. Unfortunately we don't have a good buddy build mechanism for Jenkins at the moment. I'll ping back when I update. |
Moving out serialization work to #1520 |
Reintroduces bytecode verification unittests for library code. We previously had this check in SD days, but it was complicated and called external scripts to work. The new version uses just RL to compare against the header file directly. A number of changes had to be made:
Due to the changes to serialization all of the library bytecode headers needed to be changed.