TODO: §48 package re-exports and §49 cross-file instance-member tail planned
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
66f38987ac
commit
859742ac84
1 file changed
+112
-5
@@ -4787,11 +4787,118 @@ census, 21 485 symbols).
|
||||
sweep unchanged; a before/after of `definition` on 200 type-name
|
||||
positions over opentitan (read-only) to show nothing regressed.
|
||||
|
||||
- [ ] 47.1 `DataType::name_span` + `segments()`, size ruled
|
||||
- [ ] 47.2 `StmtKind::Disable` name span
|
||||
- [ ] 47.3 `scan.rs` deleted; binder reads spans; census pin extended
|
||||
- [ ] docs: feature README; topo §2.9-2 struck (lead); semantic READMEs
|
||||
- [ ] Gates (guarded)
|
||||
- [x] 47.1 `DataType::name_span` + `segments()`, size ruled
|
||||
- [x] 47.2 `StmtKind::Disable` name span
|
||||
- [x] 47.3 `scan.rs` deleted; binder reads spans; census pin extended
|
||||
- [x] docs: feature README; topo §2.9-2 struck (lead); semantic READMEs
|
||||
- [x] Gates (guarded): 3 814 tests / 0 failed / 44 ignored (the 0.44.0 count
|
||||
exactly — six `scan.rs` unit tests out, six new ones in); corpus 814/820,
|
||||
the per-file TSV byte-identical to the committed one; `format --stdout`
|
||||
of all 860 corpus files identical to `lucisv-0.44.0`; clippy and fmt
|
||||
clean; release server smoke OK; census 27 486 symbols / 103 870
|
||||
references / 0 unplaced, identical to a `v0.44.0` scratch worktree; 200
|
||||
`definition` positions over opentitan identical old vs new
|
||||
- [ ] QA: census re-derived; escaped and scoped type names; `iface.mp`
|
||||
ports; implicit types; definition/hover on type names over
|
||||
opentitan (read-only)
|
||||
|
||||
## 48. Package re-exports as real references (planned 2026-09-05) — topo §2.9-16
|
||||
|
||||
One lane after §47 merges, §36's protocol. Feature README:
|
||||
`docs/features/package-reexports/README.md`. Ships in 0.45.0.
|
||||
|
||||
`ItemKind::Export(paths)` is bound as an opaque leaf (`bind/item.rs`, the
|
||||
dpi-export handshake). Two halves, both here:
|
||||
|
||||
- **The binding half.** `export pkg::item;` and `export pkg::*;` record
|
||||
`pkg` as a `Target::Unit` reference and `item` as a
|
||||
`Target::UnitMember(pkg)` reference — exactly the halves
|
||||
`bind_import_path` records — **without** pushing a scope import: a
|
||||
re-export brings nothing into the exporting scope (IEEE 1800 §26.6). One
|
||||
new binder function beside `bind_import_path`, sharing its path walk.
|
||||
`export *::*;` records no references (there is no name to resolve) and
|
||||
is documented as "everything this package imports is re-exported".
|
||||
- **The resolution half.** A file that does `import a_pkg::*` (or names
|
||||
`a_pkg::x`) must resolve `x` when `a_pkg` re-exports it from `b_pkg`.
|
||||
The index records each package's re-exports as facts (`FACTS_FORMAT`
|
||||
17 → 18: an `RX` group — `(pkg, item|*)` pairs plus the `*::*` flag;
|
||||
`index_cache` drops older stores by format as it already does), and the
|
||||
member walk in `workspace/external.rs` that lists a unit's members
|
||||
follows re-exports: `a_pkg`'s members += `b_pkg`'s exported `item`, or
|
||||
all of `b_pkg`'s exports for `b_pkg::*`, or all of every package
|
||||
`a_pkg` imports for `*::*` — with a visited set so a re-export cycle
|
||||
terminates. Completion after `a_pkg::` lists them; hover/definition on
|
||||
`x` lands on `b_pkg`'s declaration; references of `b_pkg::x` include the
|
||||
uses through `a_pkg`; rename of `x` edits the re-export line's `item`
|
||||
too (the rename engine reads references, so this should follow — pin
|
||||
it).
|
||||
- Tests: binding — the two halves recorded with exact spans; no scope
|
||||
import (a name re-exported is NOT visible bare inside the exporting
|
||||
package unless also imported — pin the negative); resolution — a
|
||||
three-file workspace (b_pkg declares, a_pkg re-exports one/`*`/`*::*`,
|
||||
top imports a_pkg::*) for definition, hover, completion, references and
|
||||
rename over the wire; a re-export cycle; a re-export of a name b_pkg
|
||||
does not declare (unresolved, no panic); the census numbers re-derived
|
||||
and the delta explained (new references only); FACTS_FORMAT bump test
|
||||
(an older store is dropped whole).
|
||||
|
||||
- [ ] 48.1 binding of `export` halves, no scope import
|
||||
- [ ] 48.2 `RX` facts, FACTS_FORMAT 18, member walk through re-exports
|
||||
- [ ] docs: feature README; topo §2.9-16 struck (lead); dpi-export
|
||||
handshake (a) answered
|
||||
- [ ] Gates (guarded); census delta explained
|
||||
- [ ] QA: the three-file workspace over the wire; cycles; unknown items;
|
||||
an opentitan UVM package tree read-only (definition through a
|
||||
re-export, before/after)
|
||||
|
||||
## 49. Cross-file instance-member tail in rename (planned 2026-09-05) — topo §2.9-23
|
||||
|
||||
One lane after §48 merges, §36's protocol. Feature README:
|
||||
`docs/features/hierarchical-tail/README.md`. Ships in 0.45.0.
|
||||
|
||||
With `module sub` in `sub.sv` and `assign w = u_x.sig;` in `top.sv`,
|
||||
renaming `sub`'s internal `wire sig` edits `sub.sv` only and warns (item
|
||||
20's warning); the same shape in one file resolves and is edited. The
|
||||
cause is the export rule in `workspace/record.rs::is_exported`: a module
|
||||
exports ports and parameters only, so the cross-file member walk cannot see
|
||||
`sig` through `u_x`.
|
||||
|
||||
**Ruling (lead): a module gains a second, distinct surface.** Its
|
||||
*connection* surface stays ports + parameters (what a connection list may
|
||||
name; completion in a connection list and the `propagate-ports` engine keep
|
||||
reading exactly this). Its *hierarchical* surface is its nets, variables
|
||||
and (for nested reach) instances, which a hierarchical path may name from
|
||||
anywhere (IEEE 1800 §23.6). The index records both, tagged
|
||||
(`FACTS_FORMAT` 18 → 19 if §48 already bumped to 18, else 17 → 18: the
|
||||
member record carries a `surface` bit), and only the tail walk behind an
|
||||
*instance* (`Target::MemberOf { head: an instance … }`) reads the
|
||||
hierarchical surface. Nothing else changes what it sees.
|
||||
|
||||
- `resolve_external`: a `MemberOf` whose head resolves to an instance of
|
||||
module `M` looks `tail` up in `M`'s hierarchical surface (then nested
|
||||
instances for `u_a.u_b.sig`); the answer is a `Def` in `M`'s file, so
|
||||
rename's reference set now includes the cross-file tail and the edit
|
||||
lands on it; the §2.9-20 warning is no longer raised for a tail that
|
||||
resolved (it stays for one that did not).
|
||||
- Not widened: completion after `u_x.` in an expression MAY list the
|
||||
hierarchical surface (it is what the user is typing) — say whether it
|
||||
does and pin it either way; a connection list's completion must not.
|
||||
- Tests: `a_hierarchical_tail_that_resolves_is_renamed_with_its_declaration`
|
||||
gets its cross-file twin (two files, the edit lands in both; the warning
|
||||
gone); nested `u_a.u_b.sig`; a tail naming a port (both surfaces — one
|
||||
answer); a tail naming a parameter; a generate-block-scoped net
|
||||
(`u_x.gen[0].sig` — refuse honestly, pin); an interface instance tail
|
||||
(already resolves — unchanged); the `--check` of rename's verifier still
|
||||
refuses when a tail is ambiguous (two `sub` declarations); the census
|
||||
delta explained; opentitan (read-only): rename of an internal net used
|
||||
hierarchically from a DV bench, timing before/after, and the count of
|
||||
newly resolved references over `hw/ip/aes`.
|
||||
|
||||
- [ ] 49.1 surface bit in facts, FACTS_FORMAT bump, index member walk
|
||||
- [ ] 49.2 `MemberOf` behind an instance reads the hierarchical surface;
|
||||
rename edits the tail; the warning retired for resolved tails
|
||||
- [ ] docs: feature README; topo §2.9-23 struck (lead); record.rs's
|
||||
export doc rewritten
|
||||
- [ ] Gates (guarded); census delta explained; opentitan timing
|
||||
- [ ] QA: the shapes above over the wire; the connection-list completion
|
||||
unchanged; rename verifier refusals unchanged; opentitan before/after
|
||||
Reference in new issue
Block a user