Skip to content

Commit

Permalink
bumped vallang to 1.0.0-RC3 for changes in the fingerprinting
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Nov 3, 2023
1 parent 66d94f2 commit 8452b21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
<dependency>
<groupId>io.usethesource</groupId>
<artifactId>vallang</artifactId>
<version>1.0.0-RC2</version>
<version>1.0.0-RC3</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ fingerprints, with compile-time information for generating switch cases that use
There are several explicit contracts implemented here:
* a fingerprint is (almost) never `0`.
* the fingerprint functions in this module implement exactly the fingerprinting of the run-time that the generated code will be linked against.
This contract is tested with internal tests in this module.
This contract is tested with internal tests in this module: fingerprintAlignment and concreteFingerprintAlignment.
If these tests fail, it is possible that during a bootstrap cycle of 3 steps,
the contract is temporarily not satisfied in the first and second steps. To break the impasse, the code below allows us to generate fingerprints for
the _next_ run-time version, while the current run-time still runs the _previous_ version of the compiler. We have to disable the `concreteFingerprintAlignment`
and `fingerprintAlignment` tests temporarily during the first and second run.
* `value matches pattern ==> fingerprint(pattern) == fingerprint(value)` such that a fingerprint is always an over-approximation of matching. It may
never be the case that a value should match a pattern and the fingerprint contradicts this.
This contract is tested by the pattern matching tests for the interpreter and the compiler.
Expand Down
4 changes: 2 additions & 2 deletions test/org/rascalmpl/MatchFingerprintTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ public void testTreeApplFingerPrintStability() {
ITree tree = VF.appl(prod, VF.list());

assertEquals(tree.getMatchFingerprint(), "appl".hashCode() + 131 * 2);
assertEquals(tree.getConcreteMatchFingerprint(), "tree".hashCode() + 41 * prod.hashCode());
assertEquals(tree.getConcreteMatchFingerprint(), "appl".hashCode() + 41 * prod.hashCode());

// and now WITH a keyword parameter
tree = (ITree) tree.asWithKeywordParameters().setParameter("src", loc);

assertEquals(tree.getMatchFingerprint(), "appl".hashCode() + 131 * 2);
assertEquals(tree.getConcreteMatchFingerprint(), "tree".hashCode() + 41 * prod.hashCode());
assertEquals(tree.getConcreteMatchFingerprint(), "appl".hashCode() + 41 * prod.hashCode());
}
catch (FactTypeUseException | IOException e) {
fail(e.getMessage());
Expand Down

0 comments on commit 8452b21

Please sign in to comment.