docs, comments: describe downstream consumers by capability - #111
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 capabilityext_force_fnhook (sdf_nav,nav), theroute_cost_fnseam (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,selectionandscorecard_evalare now described as domain-neutral.scorecard,selection,tests/test_scorecard.py) now name the C++ producer ascvc::nav::nav_scorecard::to_json(). Its keys matchNavScorecard.to_dictfield for field.material_palette: documented as positional with the publiccvc::navmaterial_idenum (inc/cvc/nav/material_raster.h) andkNumMaterials. Its scorecard cross-reference now namescvc::nav::nav_scorecard.material_rasterprovenance parity:to_material_json()["provenance"]now equals the C++cvc::nav::material_raster::to_jsonvalue 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.cppon 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++ writes0and2048.12where Python writes0.0and2048.125). The comment now says this.tests/test_scorecard.py: two literal changes."ext": {"extra_metric": …}) as the key it ignores, and is renamedtest_scorecard_reader_tolerates_partial_and_ignores_extension. Its assertions are unchanged.test_scorecard_json_keys, the absent-key guard changes fromassert "rf" not in dtoassert "ext" not in d.to_dictemits 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.mdand the recipe description now say "geometry only".PROVENANCE.mdships undershare/, socvc_revisiongoes from 1 to 2, as the recipe's own comment requires.pypi-publishing-roadmap.mdand the.cvcnavhome question inCVCNAV_CPP_PORT_ROADMAP.mdare simplified the same way.NAV_STATS.md,VEHICLE_REFINEMENTS.md, the cvc::nav guide,selftest,austinandplanner.2.
docs: drop workstation-local paths from the roadmapsCVCNAV_CPP_PORT_ROADMAP.md,CVCNAV_CUDA_ASSESSMENT.mdandCVCNAV_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 PDFsdocs/cvc-nav-and-grl-snam-guide.pdfwas 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.file://URIs into a local checkout, because WeasyPrint resolved the relative links against the render directory. Both PDFs are now rendered withhttps://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 pathcoef_sdf.pt'smeta["sdf_npz"]and the.cvcnavprovenance trailer held an absolute path into the trainer's checkout.tools/train.pystoresos.path.abspath(sdf_npz), and the trailer isjson.dumpsof the same meta. Both now sayaustin_south/nav_sdf.npz. The.cvcnavwas rewritten withcoef_export.write_coef_mlpfrom the edited meta..cvcnavblob is byte-identical up to the meta trailer: same header,arch_hashand weight floats.cvc_revision2 from change 1 covers the byte change, andPROVENANCE.mdnotes it.Behaviour
ast.dumpof every touched.pyfile was compared old vs new:material_raster.pydiffers only in the provenance constant.test_scorecard.pydiffers only in the renamed test and its ignored-key literals (now"ext"/"extra_metric").publish-weights-cvc.ymlparses to the same data as before (comment-only change).recipe.yamldiffers only incvc_revisionanddescription.Testing
pycvc: 384 passed, 27 skipped, the same asmain. The skip set is identical: the native parity tests skip withoutpycvc.black --check(26.5.1) andruff checkpass on the touched files.py_compilepasses on the touched files.stringsover every tracked binary, the.ptpickle, the.cvcnavtrailer, and the PDFs' link annotations and decompressed streams. The only link targets left in the PDFs arehttps://cvcpkg.org/guide,https://transfix.github.io/libcvc/and the two GitHub doc links.After merge
publish-weights-cvcwithdry_run=falseso the publishedgrl-snam-weightsgets the updatedPROVENANCE.md, description and metadata. The workflow packs with--bump.Follow-ups (not in this PR)
tools/train.pystill recordsos.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.