Issue1186

Title Refactor EagerSearch::step() into smaller helper functions
Priority wish Status resolved
Superseder Nosy List davidspeck, jendrik, malte, simon, tanja
Assigned To Keywords
Optional summary
The step() function in EagerSearch is currently around 170 lines long and 
performs 
multiple distinct tasks; for example: node popping, duplicate checking, 
heuristic 
(re-)evaluation, dead-end detection, node expansion, statistics reporting, etc.

We would like to refactor step() by decomposing it into multiple focused helper 
functions (e.g., pop_min_node(), expand_node(), process_successor(), etc.), each 
with 
a single, clear responsibility.

Created on 2025-07-21.13:43:31 by davidspeck, last changed by davidspeck.

Summary
The step() function in EagerSearch is currently around 170 lines long and 
performs 
multiple distinct tasks; for example: node popping, duplicate checking, 
heuristic 
(re-)evaluation, dead-end detection, node expansion, statistics reporting, etc.

We would like to refactor step() by decomposing it into multiple focused helper 
functions (e.g., pop_min_node(), expand_node(), process_successor(), etc.), each 
with 
a single, clear responsibility.
Messages
msg11880 (view) Author: davidspeck Date: 2025-07-30.11:45:21
Merged.
msg11873 (view) Author: davidspeck Date: 2025-07-25.11:17:24
The first round of experiments is complete: 
https://ai.dmi.unibas.ch/_experiments/ai/downward/issue1186/data/ .

Some findings:
- The number of expansions and evaluations is the same for all test configurations when 
comparing the feature branch and the main branch.
- The search time looks almost identical.
- For A* with lmcut, there is one instance that only the main branch solves, and one that only 
the issue branch solves (so total coverage is the same). However, the total time for those two 
instances is close to 1800s. I would therefore attribute this to cluster noise.
- For satisficing planning, Eager-Lama-First solves two more instances on the feature branch, 
but those instances have again a total time close to 1800s.

Overall, I think this confirms that the refactoring did not alter the functionality or 
negatively affect performance.
msg11863 (view) Author: davidspeck Date: 2025-07-23.12:35:44
PR: https://github.com/aibasel/downward/pull/266
History
Date User Action Args
2025-07-30 11:45:21davidspecksetstatus: in-progress -> resolved
messages: + msg11880
2025-07-25 11:17:24davidspecksetmessages: + msg11873
2025-07-23 12:35:44davidspecksetmessages: + msg11863
summary: The step() function in EagerSearch is currently around 170 lines long and performs multiple distinct tasks; for example: node popping, duplicate checking, heuristic (re-)evaluation, dead-end detection, node expansion, statistics reporting, etc. We would like to refactor step() by decomposing it into multiple focused helper functions (e.g., pop_min_node(), expand_node(), process_successor(), etc.), each with a single, clear responsibility. -> The step() function in EagerSearch is currently around 170 lines long and performs multiple distinct tasks; for example: node popping, duplicate checking, heuristic (re-)evaluation, dead-end detection, node expansion, statistics reporting, etc. We would like to refactor step() by decomposing it into multiple focused helper functions (e.g., pop_min_node(), expand_node(), process_successor(), etc.), each with a single, clear responsibility.
2025-07-21 13:43:31davidspeckcreate