Skip to content

Update the scoring rules for Norway#388

Merged
vicb merged 2 commits into
masterfrom
vicb/nw-factors
Apr 23, 2026
Merged

Update the scoring rules for Norway#388
vicb merged 2 commits into
masterfrom
vicb/nw-factors

Conversation

@vicb
Copy link
Copy Markdown
Owner

@vicb vicb commented Apr 23, 2026

Summary by Sourcery

Bug Fixes:

  • Correct Norway scoring multipliers for free and FAI triangle tasks.

Summary by CodeRabbit

  • Updates
    • Adjusted scoring calculation multipliers to improve weighting accuracy for regional scoring rules.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts Norway scoring rule multipliers and closing distance weights for free and FAI triangles in the optimizer scoring rules configuration.

Flow diagram for updated Norway scoring rules configuration

flowchart TB
  start[Start scoring for Norway]
  start --> A[Apply openDistance rule
  multiplier 1]
  A --> B{Is task freeTriangle?}
  B -->|Yes| C[freeTriangle
  closingDistanceRelative 0.05
  multiplier 1.6]
  B -->|No| D{Is task FAI_triangle?}
  D -->|No| E[Use openDistance score only]
  D -->|Yes| F{Which closingDistanceRelative?}
  F -->|0.05| G[faiTriangle
  closingDistanceRelative 0.05
  multiplier 1.8]
  F -->|0.2| H[faiTriangle
  closingDistanceRelative 0.2
  multiplier 1.6]
  C --> I[Compute candidate score]
  E --> I
  G --> I
  H --> I
  I --> end_node[Return best scoring option for Norway]
Loading

File-Level Changes

Change Details Files
Retune Norway scoring rule to reduce multipliers for free and FAI triangles at both closing distance thresholds.
  • Decrease free triangle multiplier at 5% closing distance from 1.7 to 1.6
  • Decrease free triangle multiplier at 20% closing distance from 1.5 to 1.4
  • Decrease FAI triangle multiplier at 5% closing distance from 2.4 to 1.8
  • Decrease FAI triangle multiplier at 20% closing distance from 2.2 to 1.6 while keeping closing distance thresholds unchanged
libs/optimizer/src/lib/scoring-rules.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@vicb vicb changed the title Update the scoring rules fro Norway Update the scoring rules for Norway Apr 23, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Please fix the PR title typo ('fro' → 'for') so it’s clear and searchable in the history.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Please fix the PR title typo ('fro' → 'for') so it’s clear and searchable in the history.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@vicb has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 43 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 50 minutes and 43 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b78b7022-a78d-48e6-9042-399150c4c479

📥 Commits

Reviewing files that changed from the base of the PR and between 2f3f5eb and 2bec6dd.

📒 Files selected for processing (1)
  • libs/optimizer/src/lib/optimizer.spec.ts

Walkthrough

The norwayRule scoring configuration in the optimizer module was updated by adjusting numeric multipliers for freeTriangle and faiTriangle across two closingDistanceRelative threshold levels. The rule structure and entry count remain unchanged.

Changes

Cohort / File(s) Summary
Scoring Configuration
libs/optimizer/src/lib/scoring-rules.ts
Updated numeric multipliers for freeTriangle and faiTriangle in the norwayRule configuration at closingDistanceRelative thresholds of 0.05 and 0.2. No structural or API-level changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A hop through the numbers, a tweak here, a tune,
The rabbit adjusted the scoring quite soon,
Multipliers shifted with mathematical grace,
To optimize Norway's competitive race! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Update the scoring rules for Norway' directly and clearly describes the main change—updating Norway-specific scoring rule multipliers in the norwayRule configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vicb/nw-factors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 23, 2026

Deploying flyxc with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2bec6dd
Status: ✅  Deploy successful!
Preview URL: https://b96cd20c.flyxc.pages.dev
Branch Preview URL: https://vicb-nw-factors.flyxc.pages.dev

View logs

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@libs/optimizer/src/lib/scoring-rules.ts`:
- Around line 40-43: Update the Norway triangle multiplier values so they match
the 2026 XContest rules: change the entry spreading ...freeTriangle with
multiplier 1.4 (closingDistanceRelative: 0.2) to multiplier 1.5, change the
...freeTriangle with multiplier 1.6 (closingDistanceRelative: 0.05) to 1.7,
change the ...faiTriangle with multiplier 1.6 (closingDistanceRelative: 0.2) to
2.2, and change the ...faiTriangle with multiplier 1.8 (closingDistanceRelative:
0.05) to 2.4; locate and modify the array entries that use the freeTriangle and
faiTriangle objects so only the multiplier fields are updated while leaving
closingDistanceRelative values unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e2cea844-c1cc-4886-93a4-5c780861972a

📥 Commits

Reviewing files that changed from the base of the PR and between 273a7a7 and 2f3f5eb.

📒 Files selected for processing (1)
  • libs/optimizer/src/lib/scoring-rules.ts

Comment on lines +40 to +43
{ ...freeTriangle, multiplier: 1.6, closingDistanceRelative: 0.05 },
{ ...freeTriangle, multiplier: 1.4, closingDistanceRelative: 0.2 },
{ ...faiTriangle, multiplier: 1.8, closingDistanceRelative: 0.05 },
{ ...faiTriangle, multiplier: 1.6, closingDistanceRelative: 0.2 },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n libs/optimizer/src/lib/scoring-rules.ts | sed -n '35,50p'

Repository: vicb/flyXC

Length of output: 827


🌐 Web query:

XContest Norway scoring rules 2026 triangle multipliers

💡 Result:

In XContest Norway (Distanseligaen) for 2026, the scoring factors (multipliers) for triangle tasks, applied to the optimized distance, are: - 5-point distance (free distance): 1.0 - Free triangle: 1.5 - Closed free triangle (closing distance <5%): 1.7 - FAI triangle: 2.2 - Closed FAI triangle (closing distance <5%): 2.4 A flight scores as a triangle if the straight-line distance between start and end points is less than 20% of the turnpoint distance (scoring distance = turnpoint distance minus closing distance). It scores as closed if less than 5%. FAI triangle requires no leg shorter than 28% of total triangle perimeter. XContest automatically optimizes for maximum score from the tracklog. The top 5 flights count in main leagues (HG/PG Open, etc.). Season: Oct 1 to Sep 30.

Citations:


Align Norway multipliers with the published XContest rules.

Current values under-score all triangle flights. The multipliers must match the 2026 XContest Norway rules:

  • Free triangle (20% closing): should be 1.5 (currently 1.4)
  • Closed free triangle (5% closing): should be 1.7 (currently 1.6)
  • FAI triangle (20% closing): should be 2.2 (currently 1.6)
  • Closed FAI triangle (5% closing): should be 2.4 (currently 1.8)
Proposed fix
-  { ...freeTriangle, multiplier: 1.6, closingDistanceRelative: 0.05 },
-  { ...freeTriangle, multiplier: 1.4, closingDistanceRelative: 0.2 },
-  { ...faiTriangle, multiplier: 1.8, closingDistanceRelative: 0.05 },
-  { ...faiTriangle, multiplier: 1.6, closingDistanceRelative: 0.2 },
+  { ...freeTriangle, multiplier: 1.7, closingDistanceRelative: 0.05 },
+  { ...freeTriangle, multiplier: 1.5, closingDistanceRelative: 0.2 },
+  { ...faiTriangle, multiplier: 2.4, closingDistanceRelative: 0.05 },
+  { ...faiTriangle, multiplier: 2.2, closingDistanceRelative: 0.2 },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{ ...freeTriangle, multiplier: 1.6, closingDistanceRelative: 0.05 },
{ ...freeTriangle, multiplier: 1.4, closingDistanceRelative: 0.2 },
{ ...faiTriangle, multiplier: 1.8, closingDistanceRelative: 0.05 },
{ ...faiTriangle, multiplier: 1.6, closingDistanceRelative: 0.2 },
{ ...freeTriangle, multiplier: 1.7, closingDistanceRelative: 0.05 },
{ ...freeTriangle, multiplier: 1.5, closingDistanceRelative: 0.2 },
{ ...faiTriangle, multiplier: 2.4, closingDistanceRelative: 0.05 },
{ ...faiTriangle, multiplier: 2.2, closingDistanceRelative: 0.2 },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/optimizer/src/lib/scoring-rules.ts` around lines 40 - 43, Update the
Norway triangle multiplier values so they match the 2026 XContest rules: change
the entry spreading ...freeTriangle with multiplier 1.4
(closingDistanceRelative: 0.2) to multiplier 1.5, change the ...freeTriangle
with multiplier 1.6 (closingDistanceRelative: 0.05) to 1.7, change the
...faiTriangle with multiplier 1.6 (closingDistanceRelative: 0.2) to 2.2, and
change the ...faiTriangle with multiplier 1.8 (closingDistanceRelative: 0.05) to
2.4; locate and modify the array entries that use the freeTriangle and
faiTriangle objects so only the multiplier fields are updated while leaving
closingDistanceRelative values unchanged.

@vicb vicb merged commit bd17792 into master Apr 23, 2026
7 checks passed
@vicb vicb deleted the vicb/nw-factors branch April 23, 2026 10:00
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.

1 participant