Skip to content

Make price cycle iterations configurable - #1555

Merged
tsmbland merged 2 commits into
mainfrom
price_cycle_iterations
Sep 22, 2026
Merged

tsmbland merged 2 commits into
mainfrom
price_cycle_iterations

Conversation

@tsmbland

@tsmbland tsmbland commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Removing the hardcoded N_CYCLE_ITERATIONS for circularity price calculation and creating a new configurable parameter price_cycle_iterations. Keeping the default as 1 for now, but I think 2 might be better.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change to fix an issue)
  • New feature (non-breaking change to add functionality)
  • Refactoring (non-breaking, non-functional change to improve maintainability)
  • Optimization (non-breaking change to speed up the code)
  • Breaking change (whatever its nature)
  • Documentation (improve or add documentation)

Key checklist

  • All tests pass: $ cargo test
  • The documentation builds and looks OK: $ cargo doc
  • Update release notes for the latest release if this PR adds a new feature or fixes a bug
    present in the previous release

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.88%. Comparing base (6635502) to head (a677af9).

Files with missing lines Patch % Lines
src/model/parameters.rs 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1555   +/-   ##
=======================================
  Coverage   90.88%   90.88%           
=======================================
  Files          61       61           
  Lines        9109     9121   +12     
  Branches     9109     9121   +12     
=======================================
+ Hits         8279     8290   +11     
  Misses        509      509           
- Partials      321      322    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tsmbland
tsmbland marked this pull request as ready for review September 22, 2026 09:45
Copilot AI lite review requested due to automatic review settings September 22, 2026 09:45

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: a677af9 Previous: 6a19604 Ratio
example_run/two_outputs example 646641927.5 ns 485146523.5 ns 1.33
select_best_assets_parallel/01 13690478.465277778 ns 9132896.765151516 ns 1.50
select_best_assets_parallel/05 39035384.125 ns 26819628.777777776 ns 1.46
select_best_assets_parallel/10 66671843.33333333 ns 45113674.75 ns 1.48
select_best_assets_parallel/15 95127633.25 ns 65351435.33333333 ns 1.46
select_best_assets_parallel/20 125093015.5 ns 85097739.5 ns 1.47
select_best_assets_sequential/01 13602696.320833333 ns 9107675.635526314 ns 1.49
select_best_assets_sequential/05 65397523.66666667 ns 43859325.75 ns 1.49
select_best_assets_sequential/10 130282616.5 ns 87553632.5 ns 1.49
select_best_assets_sequential/15 196109821 ns 131658938.5 ns 1.49
select_best_assets_sequential/20 262064023 ns 175652280.5 ns 1.49

This comment was automatically generated by workflow using github-action-benchmark.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Add a focused cyclic-market pricing test covering configured iterations and default behavior.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Makes cyclic-market price iterations configurable via price_cycle_iterations, defaulting to one.

Changes:

  • Replaces the hardcoded iteration count.
  • Adds parameter validation and schema documentation.
  • Updates pricing documentation and release notes.
File Summary
src/​simulation/​prices.rs Applies the configurable iteration count.
src/​model/​parameters.rs Defines, defaults, validates, and tests the parameter.
schemas/​input/​model.yaml Documents the new input field.
docs/​release_notes/​upcoming.md Records the new feature.
docs/​model/​prices.md Explains iterative price refinement.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/simulation/prices.rs
@tsmbland
tsmbland merged commit 1612d17 into main Sep 22, 2026
9 of 10 checks passed
@tsmbland
tsmbland deleted the price_cycle_iterations branch September 22, 2026 09:50
@tsmbland tsmbland mentioned this pull request Sep 22, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants