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

Feat: flatten tree BlockState for SemanticStackContext #19

Merged
merged 5 commits into from
Nov 24, 2023

Conversation

mrLSD
Copy link
Owner

@mrLSD mrLSD commented Nov 20, 2023

Description

The current BlockState is represented as a tree with one parent and many children. It represents blocks as a tree with branches and leaves. Each block state has a context that contains SemanticStack. It means that all contexts also represented as a tree. Related to issue #16.

🔦 To simplify the fetching process for Codegen backends, there is an added the changes:

  • for the parent BlockState "flatten" all children's contexts. It means parent context will also include children's contexts. And it has linear representations. At the same time, it has children BlockState with their own context
  • root BlockState contains flattened linear context related to all children's BlockState context.

Tests

  • Added additional tests for all related flattened BoclState contexts.
  • Added tests for BlockState parent invokation.

🏦 BlockState changes

Added traits:

  • SemanticContext
  • GlobalSemanticContext

For BlockState trait SemanticContext implementation added invokcation for all parent BlockState nodes in context. It's guaranteed, that all parent context nodes have the same leaves as children. And root contains full representation of children's instructions.

@mrLSD mrLSD self-assigned this Nov 20, 2023
@mrLSD mrLSD added the enhancement New feature or request label Nov 20, 2023
@mrLSD mrLSD added this to the v0.3.1 milestone Nov 20, 2023
Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ef93e56) 100.00% compared to head (c226698) 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##            master       #19    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            9         9            
  Lines         1650      1758   +108     
==========================================
+ Hits          1650      1758   +108     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mrLSD mrLSD merged commit eea35c6 into master Nov 24, 2023
2 checks passed
@mrLSD mrLSD deleted the feat/flat-block-state branch November 24, 2023 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant