feat: hierarchical multi-structure auction with post-review fixes#2
Open
miciav wants to merge 31 commits into
Open
feat: hierarchical multi-structure auction with post-review fixes#2miciav wants to merge 31 commits into
miciav wants to merge 31 commits into
Conversation
All quality gates pass: - 83 tests pass (18 hierarchical-specific) - ruff: clean - mypy: clean - coverage: 51% (hierarchical_auction core: 87-96%)
…are after hierarchical levels - engine: broadcast service_quantum per-function, skip seller==buyer, sort candidates by effective bid, compute quantity = min(want, tokens*quantum) - runner: extract compute_offloaded_demand(), initialize rmp_omega, recompute compute_social_welfare after hierarchical allocations, pass rmp_omega to check_stopping_criteria - token_manager: preserve quantity ratio on partial token acceptance - tests: +5 tests for service quantum, no self-allocation, seller preference, offloaded demand, partial acceptance ratio
…unction Removed the fragile zero-sentinel guard (`if np.allclose(structure_price, 0.0)`) that prevented recomputation when the legitimate price is zero (eta=0, zero node prices). The call to compute_structure_price is now made once per structure, immediately before the inner per-function loop, making intent explicit and safe. Added regression test for a two-function zero-price network. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… production Add _extract_latency helper using nx_adjacency_matrix with network_latency weight, call it once before the time loop, and pass the result to both define_bids and run_higher_levels (replacing the previous np.zeros placeholders). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… call Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…blic exports Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ze loops, cache available tokens, move engine out of loop
…LI parsing Brings coverage from 52% to 60% (+406 covered statements). Highlights: - models/sp.py 44→86%, models/auction_models.py 45→84% - generate_data.py 49→76%, run_centralized_model.py 37→63% - what_if_analysis.py 33→53%, run_faasmacro.py 26→35% Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add config_files/planar_hierarchical.json for running the hierarchical auction model on Sage-generated planar degree-3 graphs (Nn 10-50, 3 repetitions). Document the workflow and conda install requirement in README. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- fix: omega_bar and y_bar params use PYO_PARAM_TYPE (NonNegativeReals) instead of PYO_VAR_TYPE — solver outputs can be fractional - fix: import PYO_PARAM_TYPE in models/sp.py - fix: use nx. prefix for circular_ladder_graph and adjacency_matrix in generators/generate_data.py after merge removed explicit imports - fix: add hierarchical termination condition format to postprocessing parser in run.py (missing obj. deviation / best it fields) - fix: remove undefined title_key references in rlagents/postprocessing.py - feat: add pre-commit ruff hook (pre-push stage) - test: regression tests for omega_bar/y_bar float domain and missing import - config: update planar_hierarchical.json load to sinusoidal trace type Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- hierarchical runner now saves runtime.csv with 'tot' column so that results_postprocessing can read it without falling back to FaaS-MACrO log parsing - fix deviation append to handle None (not just the string "None") in load_termination_condition for hierarchical TC format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace planar_hierarchical.json with planar_comparison.json covering centralized, faas-macro, and hierarchical on planar degree-3 graphs. Update README accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
faas-macro now writes runtime.csv with a 'tot' column at the end of each run, matching the format expected by results_postprocessing and consistent with what was added to the hierarchical runner. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
hierarchical_auction/package registered inrun.pyas methodhierarchicaly[buyer_node, seller_node, function]flow; token conflict resolution is deferred and cumulativeKey changes
hierarchical_auction/— new package:types,structure,structure_graph,token_manager,pricing,flow_mapper,engine,runnerrun.py—hierarchicaladded to method choicesengine.py—compute_structure_pricemoved outsidefor floop (removes fragile zero-sentinel caching)runner.py— real latency extracted from graph via_extract_latency(graph), passed to bothdefine_bidsandrun_higher_levels;latency_weightis now effective in productionengine.py—assert token_manager.check_global_feasibility()enforces Invariant 3 after each level loopomega = result.omegaassignment,bid_pricefield, expanded__init__.pyexportsTest plan
uv run pytest tests/test_hierarchical_types.py tests/test_hierarchical_structure_graph.py tests/test_hierarchical_token_manager.py tests/test_hierarchical_pricing.py tests/test_hierarchical_flow_mapper.py tests/test_hierarchical_engine.py tests/test_hierarchical_runner.py tests/test_coverage_expansion.py -v— all 42 passuv run pytest --cov --cov-report=term-missing -q— 94 tests pass, 51% coverageuv run ruff check .— zero errorsuv run mypy— zero errors🤖 Generated with Claude Code