feat: Simple bruteforce worker for full action set evaluation#613
Open
nicow-elia wants to merge 7 commits into
Open
feat: Simple bruteforce worker for full action set evaluation#613nicow-elia wants to merge 7 commits into
nicow-elia wants to merge 7 commits into
Conversation
Signed-off-by: Nico Westerbeck <Nico.Westerbeck@50hertz.com>
Signed-off-by: Nico Westerbeck <Nico.Westerbeck@50hertz.com>
Signed-off-by: Nico Westerbeck <Nico.Westerbeck@50hertz.com>
Signed-off-by: Nico Westerbeck <Nico.Westerbeck@50hertz.com>
Signed-off-by: Nico Westerbeck <Nico.Westerbeck@50hertz.com>
Signed-off-by: Nico Westerbeck <Nico.Westerbeck@50hertz.com>
Signed-off-by: Nico Westerbeck <Nico.Westerbeck@50hertz.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a standalone DC bruteforce worker/optimizer path to exhaustively evaluate combinations of the full action set (baseline for the paper), and refactors the DC worker’s command idle-loop into a shared module so it can be reused.
Changes:
- Added a new
dc_bruteforceoptimizer/worker implementation plus a lazy workset generator for exhaustive enumeration. - Refactored the DC worker’s Kafka idle-loop into
dc.worker.idle_loopand moved/added tests accordingly. - Extracted shared metric aggregation logic into
get_aggregate_metrics()and added bruteforce scoring consistency tests.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/dc/worker/worker.py | Removes inline idle-loop and imports shared idle_loop() helper. |
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/dc/worker/idle_loop.py | New shared Kafka idle-loop implementation (used by DC + bruteforce workers). |
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/dc/genetic_functions/scoring_functions.py | Adds get_aggregate_metrics() helper and reuses it in overload computation. |
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/dc_bruteforce/init.py | New package init + module description for bruteforce components. |
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/dc_bruteforce/generator.py | New lazy exhaustive workset generator utilities. |
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/dc_bruteforce/optimizer.py | New bruteforce optimizer runtime (initialize, epoch loop, scoring, message conversion). |
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/dc_bruteforce/worker.py | New standalone Kafka worker that runs the bruteforce optimizer. |
| packages/topology_optimizer_pkg/tests/dc/worker/test_idle_loop.py | New tests covering shared idle_loop() behavior. |
| packages/topology_optimizer_pkg/tests/dc/worker/test_dc_optimizer_worker.py | Removes idle-loop tests after refactor; keeps DC worker tests focused on worker behavior. |
| packages/topology_optimizer_pkg/tests/dc_bruteforce/test_brute_generator.py | Unit tests for bruteforce workset generation and chunking. |
| packages/topology_optimizer_pkg/tests/dc_bruteforce/test_brute_optimizer.py | Tests bruteforce initialization, epoch execution, and scoring equivalence with GA scoring path. |
| packages/topology_optimizer_pkg/tests/dc_bruteforce/test_brute_worker.py | Tests bruteforce worker optimization loop emits start/stats/stop signals. |
| packages/topology_optimizer_pkg/tests/benchmark/test_dc_bruteforce_generator.py | Adds a performance-oriented benchmark test for workset generation throughput. |
| ): | ||
| return command.command | ||
|
|
||
| logger.warning(f"Received unknown command, dropping: {command} / {message.value}") |
Comment on lines
+661
to
+664
| return ActionIndexComputations( | ||
| action=jnp.asarray(action_index), | ||
| pad_mask=jnp.ones((chunk_size,), dtype=bool), | ||
| ), jnp.asarray(disconnections) |
Comment on lines
+37
to
+38
| assert len(chunk) == chunk_size | ||
| assert elapsed_seconds < 2.0 |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.




... to have a baseline for the paper ...
Checklist
Please check if the PR fulfills these requirements:
Does this PR already have an issue describing the problem?
Fixes #
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change?