Comparing my concatenation changes with main reminded me that NodeCountMapper doesn't currently accumulate node counts from functions into the overall count. It should be given a map_function_definition method that does something similar to CallSiteCountMapper: https://github.com/inducer/pytato/blob/78b43c197390d7aee1ec86357660d833223ddb69/pytato/analysis/__init__.py#L435-L446
I wonder if the default map_function_definition implementation in CachedWalkMapper should be disabled, to avoid bugs like this? Maybe a default implementation could be provided in a separate method, e.g. _basic_map_function_definition, for convenience in mappers that don't need special behavior.
Comparing my concatenation changes with
main
reminded me thatNodeCountMapper
doesn't currently accumulate node counts from functions into the overall count. It should be given amap_function_definition
method that does something similar toCallSiteCountMapper
: https://github.com/inducer/pytato/blob/78b43c197390d7aee1ec86357660d833223ddb69/pytato/analysis/__init__.py#L435-L446 I wonder if the defaultmap_function_definition
implementation inCachedWalkMapper
should be disabled, to avoid bugs like this? Maybe a default implementation could be provided in a separate method, e.g._basic_map_function_definition
, for convenience in mappers that don't need special behavior.