Interactions-HSG / Interactions-HSG/losim
A lab cannot put a value it computed on the picture: revealedAt() is built every frame and drawn nowhere
- Dominant language
- Java
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
A node's picture shows its machine and not its contents. Memory held, memory free, cores busy, calls queued, the method currently running — all there. What the program *computed* is not, and there is no way to ask for it.
`reveal(key, value)` is the call that exists for this, and the manual says so: "Without it, the trace records that a handler ran. With it, the trace records selected values from the computation." It lands as a `state` event on the node. But `state` events reach the answer table and the trace JSON only; nothing draws them.
## What is already in the viewer
In the trace model:
```js
revealedAt(e){ // every reveal at or before this instant,
let t=new Map; // keyed `${vm}\0${key}` -> value
for(let r of this.events){
if("state"!==r.kind||Number(r.t??0)>e)continue;
let i=r.detail??{};
t.set(`${r.vm}\u0000${String(i.key)}`,i.value);
}
return t;
}
```
That is exactly the per-node value map the picture would need, computed as a pure function of the instant like everything else on the film. It is called from nowhere: one occurrence across every chunk in `losim/viewer/_next/static/chunks/`, the definition. No component filters on `kind === "state"` either, and `state` is not in the marker set, so a reveal is not a scrubber marker or an Overview event either.
(`just` — the notable events within `duration/240` of the current instant, built in the same frame object — is computed and never rendered too. Different feature, same shape, mentioning it in case one fix covers both.)
## The gap this leaves
For any system whose subject is *which node holds what* — a replicated store, a cache, a shard map, a leader's view of membership — the film shows the one thing the design is not about and hides the thing it is. Divergence between two nodes is invisible on the picture even while it is the whole point of the run, and the only way to see it is to catch a value in flight in a message digest and infer the rest.
The message digest is currently the only path a payload number has to the screen, and it is narrow by design: it drops any string shorter than 25 characters, drops `from` / `to` / `node` / `zone` / `holder` / `holders` / `worker` / `instance`, and caps at two fields. So a store keyed by short strings can put its *version* on screen but never its key or a textual value. Making a field numeric is the current workaround, and it is a schema change made for the renderer's benefit, which is the wrong way round.
## The ask
**Let the program nominate what appears, and draw it.** Three shapes, cheapest first:
1. **The node panel renders revealed values.** Hover or pin a node, and it lists that node's `reveal`ed keys at the current instant, updating as the film plays. `revealedAt(t)` already returns this; nothing new has to be measured. This alone would close the gap, since the panel is where "what is true about this node" is already answered.
2. **One nominated key on the node's face.** A node carries many revealed keys and the film has room for roughly one line, so the choice has to be explicit rather than "draw them all". Either end could own it — a viewer-side pick (`?show=`, a dropdown beside the zone and role filters) or a program-side one, e.g. a distinguished call
```java
Losim.current().show("x", value); // reveal(), and put it under the node
```
A viewer-side pick has the advantage of needing no API and no re-run, and of letting the reader change their mind mid-film.
3. **A field list for the digest.** Either keep short strings when there is room, or let a simulation name the fields it wants on its messages, so a value does not have to be an `int64` to be legible.
Happy to take a swing at (1) if the direction is right — it looks like wiring an existing method into an existing panel.
## Not this issue
A separate ask, filed separately if you want it: every method gets the same rounded-rectangle pill and its colour is the task hue, so an operation has no visual identity and the film has no legend. Distinguishing a read from a write at a glance needs a second encoding channel, since colour is taken.
---
Observed in **3.1.1**, against the viewer bundled in the jar.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in the viewer trace model and locate the node panel alongside revealedAt(e) in losim/viewer/_next/static/chunks/. Verify how the panel obtains the current frame and node identity, then wire revealedAt(t) into that panel. Done means revealed keys and values for the selected node update correctly as the film is scrubbed or played.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript
- Domain
- data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100