You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which of the usages of ._sframes_container are actually necessary. To see all usages: f96ef86
audit the following test files and either remove, unskip, or provide clear commentary as to why the skipped test needs to stay in (Better Router Mapping #689 unified using STABLE_SLOT_GENERATION: bool constants currently `False):
tests/integration/sourcemap_monkey_integ_test.py
tests/unit/sourcemap_constructs311_test.py
tests/unit/sourcemap_constructs_allpy_test.py
tests/unit/sourcemap_monkey_unit_test.py
tests/unit/sourcemap_test.py
At the end of Better router mapping #676 pay close attention to _PyTealSourceMap._infer() and see which lines are still being hit. Probably, there will be some situations that are no longer needed. (Better Router Mapping #689 tightened this up)
Refactor NatalStackFrame to provide a single frame instead of a list
Coverage triage
first item to notice: we could do better on subroutines such as the recursive fibonacci example:
Investigate the feasibility of removing the _sframes_container property from class TealComponent and whenever this is needed, simply overwrite either self.expr.stack_frames or self._stack_frames. (partially removed from much of hierarchy in Better Router Mapping #689)
If feasible, implement it
Also consider having a new method NatalStackFrame.spawn() that keeps the original NatalStackFrame as a child.
It's likely that _PyTealSourceMapper will never be exposed to the end-user. In that case, the logic for caching build items is overly complex. This should be simplified at the end or shortly after Better router mapping #676
Medium - while the urgency of any improvement individually is Low, addressing at least a few of these issues in the short term will improve the feature's usefuleness.
The text was updated successfully, but these errors were encountered:
Problem
There were a few issues that were not resolved at the time of merging #650 .
Solution - Implement the following small improvements
_PyTealMapper.annotate()
(cf: https://github.com/tzaffi/pyteal/blob/f2a945a8eeb396e9c544b62cd3d1a6383bfc9bff/pyteal/compiler/sourcemap.py#L844)StackFrame._frame_info_is_right_before_core()
(renamed in Teal to PyTeal Source Mapper #650)StackFrame - PyTealFrame - TealMapItem
hierarchy (Better Router Mapping #689)._sframes_container
are actually necessary. To see all usages: f96ef86STABLE_SLOT_GENERATION: bool
constants currently `False):_PyTealSourceMap._infer()
and see which lines are still being hit. Probably, there will be some situations that are no longer needed. (Better Router Mapping #689 tightened this up)NatalStackFrame
to provide a single frame instead of a listpyteal/tests/unit/sourcemap_constructs311_test.py
Line 1901 in 6a49be7
pyteal/tests/unit/sourcemap_constructs311_test.py
Line 1955 in 6a49be7
mjpieters
's SourceMap to get faster R3SourceMap (cf: https://github.com/tzaffi/pyteal/blob/f2a945a8eeb396e9c544b62cd3d1a6383bfc9bff/pyteal/compiler/sourcemap.py#L75)_sframes_container
property fromclass TealComponent
and whenever this is needed, simply overwrite eitherself.expr.stack_frames
orself._stack_frames
. (partially removed from much of hierarchy in Better Router Mapping #689)NatalStackFrame.spawn()
that keeps the originalNatalStackFrame
as a child._PyTealSourceMapper
will never be exposed to the end-user. In that case, the logic for caching build items is overly complex. This should be simplified at the end or shortly after Better router mapping #676_PyTealSourceMapper
(cf: https://github.com/tzaffi/pyteal/blob/f2a945a8eeb396e9c544b62cd3d1a6383bfc9bff/pyteal/compiler/sourcemap.py#L730)Dependencies
None
Urgency
Medium - while the urgency of any improvement individually is Low, addressing at least a few of these issues in the short term will improve the feature's usefuleness.
The text was updated successfully, but these errors were encountered: