Skip to content

Nav pt1: Make vis_throttle work out of the box#2108

Merged
jeff-hykin merged 7 commits into
mainfrom
jeff/clean/nav0
May 17, 2026
Merged

Nav pt1: Make vis_throttle work out of the box#2108
jeff-hykin merged 7 commits into
mainfrom
jeff/clean/nav0

Conversation

@jeff-hykin
Copy link
Copy Markdown
Member

Make vis_throttle work even when max_hz isn't specified.

Test with:

dimos run unitree-g1-nav-sim

@jeff-hykin jeff-hykin enabled auto-merge (squash) May 16, 2026 08:39
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 16, 2026

Greptile Summary

This PR makes vis_throttle functional even when the caller hasn't pre-populated max_hz by introducing a default_max_hz parameter and always computing per-entity rate limits as the union of visual_override entities and any user-supplied max_hz keys.

  • The old guard (if vis_throttle != 1.0 and "max_hz" in resolved) is removed; max_hz is now always built, defaulting each entity to default_max_hz * vis_throttle (60 Hz at the default throttle).
  • A previously flagged undefined-symbol bug (_pgo_graph_nodes_colors_debug) is no longer present; the correct names (_graph_nodes_colors_debug, _graph_edges_colors_debug) are defined in the file.

Confidence Score: 4/5

Safe to merge; the logic change is small and well-scoped, but the computed max_hz values are now always floats rather than integers.

The refactor is clean and the intent is clear. The only outstanding concern is that multiplying an int default_max_hz by a float vis_throttle always produces float values in the max_hz dict, which diverges from the int annotation and could silently break a downstream consumer that expects integer Hz values.

dimos/navigation/nav_stack/main.py — the max_hz dict now holds floats; worth confirming the downstream consumer handles them correctly.

Important Files Changed

Filename Overview
dimos/navigation/nav_stack/main.py Refactors nav_stack_rerun_config to always populate max_hz for every visual entity using default_max_hz * vis_throttle, replacing the old guard that skipped throttling when max_hz was absent or vis_throttle == 1.0. The undefined-symbol issue from the previous review is no longer present. One minor concern: computed max_hz values are always floats due to multiplication with the vis_throttle float, even though default_max_hz is annotated int.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["nav_stack_rerun_config(user_config, vis_throttle, default_max_hz)"] --> B["resolved = dict(user_config or {})"]
    B --> C["setdefault: blueprint, pubsubs, visual_override, static"]
    C --> D["Populate visual_override defaults"]
    D --> E{agentic_debug?}
    E -->|Yes| F["Add debug color overrides"]
    E -->|No| G["Add normal color overrides"]
    F --> H["resolved['visual_override'] = visual_override"]
    G --> H
    H --> I["Populate static defaults"]
    I --> J["resolved.setdefault('max_hz', {})"]
    J --> K["Iterate: set(visual_override) | set(resolved['max_hz'])"]
    K --> L["each_entity: get(entity, default_max_hz) * vis_throttle"]
    L --> M["return resolved"]
Loading

Reviews (6): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Comment thread dimos/navigation/nav_stack/main.py
Comment thread dimos/navigation/nav_stack/main.py
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@jeff-hykin jeff-hykin changed the title Make vis_throttle work out of the box Nav1: Make vis_throttle work out of the box May 16, 2026
@jeff-hykin jeff-hykin changed the title Nav1: Make vis_throttle work out of the box Nav pt1: Make vis_throttle work out of the box May 16, 2026
@jeff-hykin jeff-hykin closed this May 16, 2026
auto-merge was automatically disabled May 16, 2026 11:43

Pull request was closed

@jeff-hykin jeff-hykin reopened this May 16, 2026
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Comment thread dimos/navigation/nav_stack/main.py Outdated
- Restore missing dict-comprehension assignment target and opening brace
  (P0: previous code was a SyntaxError, broke import of the whole module).
- Iterate over union of visual_override and existing max_hz keys so
  caller-provided rate limits outside the default entity list survive
  (P1: previously silently dropped).
- Fix typo in comment 'preveting' -> 'preventing' (P2).

Addresses greptile comments on PR #2108.
@jeff-hykin jeff-hykin enabled auto-merge (squash) May 16, 2026 21:58
@jeff-hykin jeff-hykin closed this May 17, 2026
auto-merge was automatically disabled May 17, 2026 04:07

Pull request was closed

@jeff-hykin jeff-hykin reopened this May 17, 2026
@jeff-hykin jeff-hykin closed this May 17, 2026
@jeff-hykin jeff-hykin reopened this May 17, 2026
@jeff-hykin jeff-hykin enabled auto-merge (squash) May 17, 2026 05:34
@jeff-hykin jeff-hykin closed this May 17, 2026
auto-merge was automatically disabled May 17, 2026 06:21

Pull request was closed

@jeff-hykin jeff-hykin reopened this May 17, 2026
@jeff-hykin jeff-hykin closed this May 17, 2026
@jeff-hykin jeff-hykin reopened this May 17, 2026
@jeff-hykin jeff-hykin enabled auto-merge (squash) May 17, 2026 06:52
@jeff-hykin jeff-hykin merged commit 6e171ac into main May 17, 2026
19 checks passed
@jeff-hykin jeff-hykin deleted the jeff/clean/nav0 branch May 17, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants