GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Retain weighted predecessors in many-to-many path queries by antonsoo · Pull Request #197 · libtcod/python-tcod

Conversation

@antonsoo

@antonsoo antonsoo commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

The many-to-many branch of path2d computes weighted predecessors, then discards them and calls unweighted hillclimb2d. With cardinal cost 1 and diagonal cost 3, this can replace two cheap cardinal steps with an expensive diagonal.

Return pf.path_from(best_ij) after choosing the nearest start. Keep endpoint selection and unreachable handling. Equal-cost routes may choose different tied predecessors.

The regression covers four diagonal settings. An independent heap solver on the bundled sample dungeon confirms all 59 previously incorrect many-to-many queries, with all 1,680 single-endpoint path controls unchanged. A separate automatic-heuristic correction handles another 60 single-endpoint failures; composing both fixes matches all 2,240 queries.

Full headless tests pass (325 passed, 95 skipped), using the pinned resource submodule and SDL dummy audio driver. Mypy and applicable project formatting/hooks pass.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@antonsoo
Retain weighted predecessor paths in many-to-many queries
5762316
@codecov

codecov Bot commented Oct 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.09%. Comparing base (e974570) to head (5762316).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #197   +/-   ##
=======================================
  Coverage   86.09%   86.09%           
=======================================
  Files          29       29           
  Lines        7597     7597           
=======================================
  Hits         6541     6541           
  Misses       1056     1056           

☔ 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

HexDecimal
HexDecimal approved these changes Oct 17, 2026
View reviewed changes
@HexDecimal
HexDecimal merged commit 84dd3bb into libtcod:main Oct 17, 2026
31 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@HexDecimal HexDecimal HexDecimal approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@antonsoo @HexDecimal
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.