Translate field value digit branch helper
This commit is contained in:
parent
b860bd8bb8
commit
78c70c8b7f
8 changed files with 124 additions and 8 deletions
|
|
@ -125,14 +125,22 @@ Completed field value helper entry:
|
|||
|
||||
- `docs/research/translations/shriinivas-fieldvalue-digit-at.md`
|
||||
- Source groups: `Create Decimal`, `Create Segment`, `Seven Segments`,
|
||||
`Delete Segments`, `Digit At`
|
||||
`Delete Segments`, `Next Digit`, `Digit At`
|
||||
- Verification: decimal glyph geometry matches source with sorted max vertex
|
||||
delta `0.0`; segment geometry matches horizontal and vertical source cases
|
||||
with sorted max vertex delta `0.0`; seven-segment chassis geometry matches
|
||||
source with 74 vertices and sorted max vertex delta `0.0`; digit scalar
|
||||
helper matches source behavior across four number/position cases by driving
|
||||
`Mesh Line.Count` with the result; delete-mask scalar helper matches source
|
||||
across 195 digit/segment-position cases with zero mismatches.
|
||||
`Mesh Line.Count` with the result; next-digit branch helper matches source
|
||||
across four cases spanning both sides of `Max Precision`; delete-mask scalar
|
||||
helper matches source across 195 digit/segment-position cases with zero
|
||||
mismatches.
|
||||
|
||||
Boundary note: the full `Field Value` graph is a 176-node composition involving
|
||||
menu switches, capture attributes, sample-index reads, instances, transforms,
|
||||
and delete geometry. Before translating it by hand, test or port upstream's
|
||||
historical `nodes_to_script` converter so VibeGeometry gets a generated first
|
||||
draft to inspect.
|
||||
|
||||
## Extraction Workflow
|
||||
|
||||
|
|
|
|||
|
|
@ -128,6 +128,21 @@ Metaphor: if a graph only whispers a number, build a little megaphone around it.
|
|||
The verifier's job is not to be beautiful. It is to make the invisible output
|
||||
hard to lie about.
|
||||
|
||||
## Branch Helpers Are Switchboards
|
||||
|
||||
Some scalar helpers exist only to choose which already-tested value path should
|
||||
feed the next stage. `Next Digit` decides whether to read from the fractional
|
||||
part or the whole part of a number based on `Position < Max Precision`.
|
||||
|
||||
The useful pattern is:
|
||||
|
||||
```text
|
||||
branch condition -> candidate A -> candidate B -> switch -> value output
|
||||
```
|
||||
|
||||
Verify both sides of the branch. If all tests stay on one side, the switchboard
|
||||
has not actually been tested; it has merely sat there looking employed.
|
||||
|
||||
## Glyphs Are Parts
|
||||
|
||||
Display systems are made from small, boring geometry tokens: bars, dots,
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
- `Create Segment`
|
||||
- `Seven Segments`
|
||||
- `Delete Segments`
|
||||
- `Next Digit`
|
||||
- `Digit At`
|
||||
- Geometry Script recreation:
|
||||
`examples/geometry_script/shriinivas_fieldvalue.py`
|
||||
|
|
@ -23,6 +24,18 @@ Together they show the first display-system layers: tiny glyph geometry,
|
|||
field-sculpted segment geometry, segment composition, segment visibility masks,
|
||||
and value-only digit extraction.
|
||||
|
||||
## Current Boundary
|
||||
|
||||
The remaining full `Field Value` group has 176 nodes and combines menu switches,
|
||||
capture attributes across multiple domains, sampled fields, instancing,
|
||||
instance transforms, delete-geometry selection, material assignment, and the
|
||||
helpers translated here.
|
||||
|
||||
That graph should not be translated manually as one heroic sweep. The next
|
||||
right move is to port or test the upstream `nodes_to_script` prototype against
|
||||
this graph so the first draft can be generated, inspected, and then cleaned
|
||||
with doctrine instead of hand-copied node by node.
|
||||
|
||||
## Create Decimal Map
|
||||
|
||||
Source group: `Create Decimal`
|
||||
|
|
@ -142,6 +155,34 @@ Mechanism:
|
|||
Metaphor: `Delete Segments` is not a sculptor. It is a stencil card. Given a
|
||||
digit and a slot on the chassis, it punches out the slots that should go dark.
|
||||
|
||||
## Next Digit Map
|
||||
|
||||
Source group: `Next Digit`
|
||||
|
||||
Geometry Script group: `VG Next Digit`
|
||||
|
||||
Inputs:
|
||||
|
||||
- `Whole Part`
|
||||
- `Fraction Part`
|
||||
- `Max Precision`
|
||||
- `Position`
|
||||
|
||||
Output:
|
||||
|
||||
- `Result`
|
||||
|
||||
Mechanism:
|
||||
|
||||
- Compute `Position - Max Precision` for whole-part indexing.
|
||||
- Compare `Position < Max Precision`.
|
||||
- If true, read from `Fraction Part` at `Position`.
|
||||
- If false, read from `Whole Part` at `Position - Max Precision`.
|
||||
|
||||
Metaphor: `Next Digit` is the read head for the display tape. Before the decimal
|
||||
boundary it reads the fractional reel; after that boundary it reads the whole
|
||||
number reel.
|
||||
|
||||
## Verification
|
||||
|
||||
Run:
|
||||
|
|
@ -166,6 +207,7 @@ Results from Blender 5.1.1:
|
|||
| Digit At `1234.0`, position `1` | 3 | 3 | 0 | accepted |
|
||||
| Digit At `98765.0`, position `2` | 7 | 7 | 0 | accepted |
|
||||
| Digit At `120305.0`, position `3` | 0 | 0 | 0 | accepted |
|
||||
| Next Digit branch cases | 4 cases | 4 cases | 0 mismatches | accepted |
|
||||
| Delete Segments grid | 195 cases | 195 cases | 0 mismatches | accepted |
|
||||
|
||||
## Lessons
|
||||
|
|
@ -190,3 +232,7 @@ Results from Blender 5.1.1:
|
|||
- Dense boolean graphs often hide lookup tables. Translate them into named
|
||||
clauses and verify over the full input grid instead of preserving every source
|
||||
`OR` node as ceremony.
|
||||
- A branch helper deserves tests on both sides of the branch. `Next Digit`
|
||||
verifies positions before and after `Max Precision`, because the interesting
|
||||
behavior is not digit extraction itself but choosing which number part feeds
|
||||
extraction.
|
||||
|
|
|
|||
Loading…
Reference in a new issue