Skip to content

docs, comments: describe downstream consumers by capability - #111

Merged
transfix merged 4 commits into
mainfrom
docs/consumer-neutral-text
Oct 2, 2026
Merged

transfix merged 4 commits into
mainfrom
docs/consumer-neutral-text

Conversation

@transfix

@transfix transfix commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Docs, docstrings and comments now describe GRL-SNAM's extension seams by what they do, not by which project uses them, and the repo no longer carries workstation-local paths. Runtime code is unchanged apart from one value: the material-raster provenance string now matches the C++ generator byte for byte. Two test literals are renamed. The weight payloads' metadata now names the training SDF by a scene-relative path. The weights themselves do not change.

Companion to transfix/libcvc#538, which made the same change on the C++ side.

Changes

1. docs, comments: describe downstream consumers by capability

  • Reworded the extension seams by capability: the generic ext_force_fn hook (sdf_nav, nav), the route_cost_fn seam (scenario), and the second layer of the nav-stats design. That second layer is where a downstream extension adds its own domain-specific metrics, keyed by vehicle index. The base scorecard, selection and scorecard_eval are now described as domain-neutral.
  • The scorecard reader's docstrings and comments (scorecard, selection, tests/test_scorecard.py) now name the C++ producer as cvc::nav::nav_scorecard::to_json(). Its keys match NavScorecard.to_dict field for field.
  • material_palette: documented as positional with the public cvc::nav material_id enum (inc/cvc/nav/material_raster.h) and kNumMaterials. Its scorecard cross-reference now names cvc::nav::nav_scorecard.
  • material_raster provenance parity: to_material_json()["provenance"] now equals the C++ cvc::nav::material_raster::to_json value exactly:
    scene land cover (cvc::nav material_raster: masks if present, else satellite); ids = the 13-class material palette.
    Checked by parsing the C++ string literals out of src/cvc/nav/material_raster.cpp on docs, comments: describe downstream consumers by capability transfix/libcvc#538. The {"schema":…,"provenance":…, prefix the two generators emit is byte-identical. The rest of the document is not, because the two writers format floats differently (C++ writes 0 and 2048.12 where Python writes 0.0 and 2048.125). The comment now says this.
  • tests/test_scorecard.py: two literal changes.
    • The partial-reader test now uses a generic extension sub-object ("ext": {"extra_metric": …}) as the key it ignores, and is renamed test_scorecard_reader_tolerates_partial_and_ignores_extension. Its assertions are unchanged.
    • In test_scorecard_json_keys, the absent-key guard changes from assert "rf" not in d to assert "ext" not in d. to_dict emits neither key, so the guard is as weak as before. A follow-up should assert the exact base key set instead.
  • grl-snam-weights: PROVENANCE.md and the recipe description now say "geometry only". PROVENANCE.md ships under share/, so cvc_revision goes from 1 to 2, as the recipe's own comment requires.
  • The scope note in pypi-publishing-roadmap.md and the .cvcnav home question in CVCNAV_CPP_PORT_ROADMAP.md are simplified the same way.
  • Smaller doc wording fixes in the README, NAV_STATS.md, VEHICLE_REFINEMENTS.md, the cvc::nav guide, selftest, austin and planner.

2. docs: drop workstation-local paths from the roadmaps

  • In CVCNAV_CPP_PORT_ROADMAP.md, CVCNAV_CUDA_ASSESSMENT.md and CVCNAV_MATERIAL_PORT_ROADMAP.md, absolute paths into one developer's checkouts are replaced with paths relative to the libcvc root or to this repo.

3. docs: regenerate the cvc::nav guide and quickstart PDFs

  • docs/cvc-nav-and-grl-snam-guide.pdf was re-rendered from the updated Markdown with the same python-markdown + WeasyPrint 70.0 pipeline and stylesheet that made the original. Re-rendering the previous Markdown with that pipeline reproduces the committed PDF pixel for pixel. The only text change is the weights note in section 8, and the page count is still 18.
  • In both PDFs, the cross-links to the other doc's Markdown were file:// URIs into a local checkout, because WeasyPrint resolved the relative links against the render directory. Both PDFs are now rendered with https://github.com/CVC-Lab/GRL-SNAM/blob/main/docs/ as the base URL, so those links point at the copies on GitHub. The quickstart Markdown is unchanged, and its PDF renders identically page for page; only its link targets differ.

4. grl-snam-weights: record the training SDF by a scene-relative path

  • coef_sdf.pt's meta["sdf_npz"] and the .cvcnav provenance trailer held an absolute path into the trainer's checkout. tools/train.py stores os.path.abspath(sdf_npz), and the trailer is json.dumps of the same meta. Both now say austin_south/nav_sdf.npz. The .cvcnav was rewritten with coef_export.write_coef_mlp from the edited meta.
  • The weights are unchanged. Every checkpoint tensor is equal and its storage records are byte-identical. The .cvcnav blob is byte-identical up to the meta trailer: same header, arch_hash and weight floats. cvc_revision 2 from change 1 covers the byte change, and PROVENANCE.md notes it.

Behaviour

  • ast.dump of every touched .py file was compared old vs new:
    • All files except two are identical, or differ only in docstrings.
    • material_raster.py differs only in the provenance constant.
    • test_scorecard.py differs only in the renamed test and its ignored-key literals (now "ext"/"extra_metric").
    • With those literals mapped, both trees are structurally identical.
  • publish-weights-cvc.yml parses to the same data as before (comment-only change). recipe.yaml differs only in cvc_revision and description.

Testing

  • Full suite on Python 3.12 / torch 2.14 CPU without pycvc: 384 passed, 27 skipped, the same as main. The skip set is identical: the native parity tests skip without pycvc.
  • black --check (26.5.1) and ruff check pass on the touched files. py_compile passes on the touched files.
  • Path scan over the binaries as well as the text: strings over every tracked binary, the .pt pickle, the .cvcnav trailer, and the PDFs' link annotations and decompressed streams. The only link targets left in the PDFs are https://cvcpkg.org/guide, https://transfix.github.io/libcvc/ and the two GitHub doc links.

After merge

  • Run publish-weights-cvc with dry_run=false so the published grl-snam-weights gets the updated PROVENANCE.md, description and metadata. The workflow packs with --bump.

Follow-ups (not in this PR)

  • tools/train.py still records os.path.abspath(sdf_npz) in new checkpoints. It should store a path that does not depend on the training machine before the next weights are trained.
  • test_scorecard_json_keys: assert the exact base key set.

Reword docs, docstrings and comments that pointed at a specific
downstream consumer so they describe the extension seams by what they
do: the generic ext_force hook, the route_cost_fn seam, and the
second layer of the nav-stats design that an extension uses to add its
own domain-specific metrics. The base scorecard, selection and eval
are described as domain-neutral. The scope note in the PyPI roadmap
and the .cvcnav home question in the C++ port roadmap are simplified
the same way.

The material palette is now documented as positional with the public
cvc::nav material_id enum and kNumMaterials, and its scorecard
reference names cvc::nav::nav_scorecard. The scorecard reader's
docstrings and comments (scorecard, selection, test_scorecard) name
the C++ producer as cvc::nav::nav_scorecard::to_json(), whose keys
match NavScorecard.to_dict field for field.

material_raster: the provenance string now matches the C++
cvc::nav::material_raster::to_json value byte for byte. The rest of
the document is not byte-identical, because the two writers format
floats (bounds, mu/risk) differently; the comment says so.

test_scorecard: the partial-reader test uses a generic extension
sub-object as its ignored key and is renamed accordingly; its
assertions are unchanged. test_scorecard_json_keys also changes the
literal in its absent-key guard from "rf" to "ext". to_dict emits
neither key, so the guard is equally weak before and after; asserting
the exact base key set is left as a follow-up.

grl-snam-weights: PROVENANCE.md and the recipe description say
"geometry only". PROVENANCE.md ships under share/, so cvc_revision is
bumped to 2 as the recipe requires; the weights are unchanged.
Replace absolute paths into one developer's checkouts (worktrees and a
sibling clone) with repo-relative names: libcvc paths are given relative
to the libcvc repository root, GRL-SNAM paths relative to this repo, and
the material-fork cross-check says to point GRL_SNAM_MATERIAL_FORK at a
clone rather than at a specific directory.
Re-render docs/cvc-nav-and-grl-snam-guide.pdf from the updated
Markdown with the same python-markdown + WeasyPrint 70.0 pipeline and
stylesheet that produced the original (re-rendering the previous
Markdown with it reproduces the committed PDF pixel for pixel). The
only text change is the reworded weights note in section 8.

Both PDFs also had their cross-links to each other's Markdown written
as file:// URIs into a local checkout, because WeasyPrint resolved the
relative links against the render directory. Both are now rendered
with the GitHub docs/ directory as the base URL, so those links point
at the copies on GitHub. The quickstart Markdown is unchanged and its
PDF renders identically page for page; only its link targets differ.
Both payloads carried the training meta's sdf_npz as an absolute path
into the trainer's checkout: tools/train.py stores
os.path.abspath(sdf_npz) in the checkpoint meta, and the .cvcnav
provenance trailer is json.dumps of the same meta. Set it to
austin_south/nav_sdf.npz in the coef_sdf.pt meta and rewrite the
.cvcnav trailer from that meta with coef_export.write_coef_mlp.

The weights are unchanged. Every tensor in the checkpoint is equal and
its storage records are byte-identical; the .cvcnav blob is
byte-identical up to the meta trailer (same header, arch_hash and
weight floats). cvc_revision 2 already covers the byte change, and
PROVENANCE.md notes it.
@transfix
transfix merged commit 1885bdb into main Oct 2, 2026
3 checks passed
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