Return chips refactors #391
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Needed refactorization for #372. The changes are:
Ctrl::Choosewill now match field elements onto indices of the list of unique branches (its third argument), instead of matching onto a duplicated branch. Execute and trace generation will now need to match onto the index and use the index to jump to the branch. That also means that the default case is also an index and thus the default branch has been added to the list of unique branches, which simplifiesevalandcompute_layout_sizesa bit.Doing this indirection is only a slight penalty, not really noticeable, and it is basically the same cost as using
Arc, which is also another layer of indirection (though I believe the indices will be better for cache hits).generate_tracehas been refactored to remove duplicated work,get_func_rangehas also been refactored slightlyI've added the
query_indextoRecordbasically for identification of which coroutine has done the lookup. Nonces are not unique, thus they do not completely identify the caller. Chipset has also included the query index (i.e. which coroutine it is embedded in) so that it properly records the identification. Byte lookups have also included the index.Note: we could later perhaps parametrize this
query_indexfield so that it accounts for whatever metadata is needed. Perhaps shard indices will also become important