Skip to content
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

[fix] Introduce intermediate virtual nodes for select concrete nodes #133

Merged
merged 9 commits into from
May 24, 2020

Conversation

slarse
Copy link
Collaborator

@slarse slarse commented May 24, 2020

Fix #132

This PR introduces virtual nodes to create a layer of indirection between certain complex nodes and their child lists. This is necessary where nodes have varying amounts of certain types of children, and these children are adjacent in the "flat" representation, as otherwise there may be conflicts across syntactical boundaries.

Only a select few nodes are "exploded" with virtual nodes. Currently, it is only subtypes of CtType, CtExecutable and CtExecutableReference. To add a new type, simply add it to the list in NodeFactory.EXPLODED_TYPES.

@codecov-commenter
Copy link

codecov-commenter commented May 24, 2020

Codecov Report

Merging #133 into master will increase coverage by 0.26%.
The diff coverage is 85.71%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #133      +/-   ##
============================================
+ Coverage     80.11%   80.37%   +0.26%     
- Complexity      443      471      +28     
============================================
  Files            36       36              
  Lines          1624     1717      +93     
  Branches        243      260      +17     
============================================
+ Hits           1301     1380      +79     
- Misses          209      217       +8     
- Partials        114      120       +6     
Impacted Files Coverage Δ Complexity Δ
src/main/java/se/kth/spork/base3dm/Pcs.java 68.00% <0.00%> (-5.92%) 10.00 <0.00> (ø)
...java/se/kth/spork/spoon/matching/SpoonMapping.java 85.88% <50.00%> (-0.87%) 38.00 <0.00> (+1.00) ⬇️
...h/spork/spoon/pcsinterpreter/SporkTreeBuilder.java 79.84% <78.57%> (-0.67%) 34.00 <8.00> (+5.00) ⬇️
.../java/se/kth/spork/spoon/wrappers/NodeFactory.java 78.44% <84.72%> (+9.21%) 18.00 <12.00> (+13.00)
src/main/java/se/kth/spork/base3dm/ChangeSet.java 94.11% <100.00%> (ø) 29.00 <1.00> (ø)
src/main/java/se/kth/spork/base3dm/ListNode.java 100.00% <100.00%> (+33.33%) 6.00 <1.00> (+2.00)
src/main/java/se/kth/spork/spoon/PcsBuilder.java 100.00% <100.00%> (ø) 12.00 <8.00> (+5.00)
...kth/spork/spoon/matching/ClassRepresentatives.java 94.73% <100.00%> (+0.19%) 10.00 <0.00> (+2.00)
...h/spork/spoon/pcsinterpreter/SpoonTreeBuilder.java 87.50% <100.00%> (+0.09%) 41.00 <0.00> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4897d5...b70ad82. Read the comment docs.

@slarse
Copy link
Collaborator Author

slarse commented May 24, 2020

The PR fails the file merge benchmark as, for some reason, the changes cause previously implicit type parameters to become explicit. This does not seem to be too much of a problem in practice, I don't think it affects anything other than textual accuracy.

@slarse
Copy link
Collaborator Author

slarse commented May 24, 2020

I think the deteriorated score is related to virtual nodes that do not have children not getting the leaf child list as described in #116

@slarse slarse merged commit dab33b3 into master May 24, 2020
@slarse slarse deleted the issue/132-improve-pcs-granularity branch February 18, 2021 16:46
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.

Spork's current structural representation in PCS is insufficiently granular
2 participants