Skip to content

hud: resolve crosshair target once per frame and cache panel model pe… - #42

Merged
ThoriaDevelopment merged 1 commit into
ThoriaDevelopment:mainfrom
Verslabs:fix/hud-per-tick-panel-model
Oct 12, 2026
Merged

ThoriaDevelopment merged 1 commit into
ThoriaDevelopment:mainfrom
Verslabs:fix/hud-per-tick-panel-model

Conversation

@Verslabs

@Verslabs Verslabs commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #30. HudOverlay.render resolved the crosshair target for dwell tracking, and renderConfidencePanel resolved it again. Both the compact panel and the hover tooltip also re-read FlagHistory (tier, score, explanation, alerted checks, flag counts), which takes locks and allocates, and rebuilt their Text lines every frame.

Changes

  • The crosshair target is resolved once per frame and passed to dwell tracking and both panels.
  • New PanelModel: header, explanation and FP-hint lines, built at most once per client tick (or on a target change) and shared by the compact panel and the hover tooltip. The tooltip's extra "top flagged checks" line is built lazily, only when the tooltip is shown.
  • The tier comes from the tracker's per-tick TrackedPlayer.tier cache (what the nametag mixins read), falling back to FlagHistory.tierFor for untracked targets.
  • The cache is cleared when there is no target.
  • Display output is unchanged and at most one tick stale. All paths stay fail-open (each render call is still wrapped in try/catch).

Affected areas

  • Detection/check logic
  • Packet observation or inference
  • Config or presets
  • Commands or UI
  • Rendering or HUD
  • Replay, clips, camera, or input
  • Persistence or local data
  • Documentation/tests/tooling

Verification

Commands run (branch head 2f4536f):

python scripts/verify_contribution.py --static
./gradlew test
./gradlew build
python scripts/live_selftest.py --check pipeline-smoke

Results:

  • Static verifier: PASS (only warning: no build/selftest-manifest.json before the first live run)
  • Tests: PASS, BUILD SUCCESSFUL, 49 tests, 0 failures, 0 errors
  • Build: PASS, BUILD SUCCESSFUL

Live client verification

  • Client launch/mixin application: PASS. The real 1.21.11 client booted with this branch through runClientGameTest, and pipeline-smoke passed (1/1).
  • Scenario(s): client boot plus the detection pipeline smoke test.
  • Expected result: the client loads with the HUD callback registered and no errors.
  • Observed result: as expected.
  • Not tested: the automated suite doesn't look at HUD rendering. I haven't done a manual runClient check of the confidence panel and hover tooltip with a flagged target, and I haven't profiled the frame-time saving.

Safety and privacy review

  • No telemetry, uploads, analytics, or remote reporting were added.
  • No unintended outgoing gameplay packets were added.
  • Fail-open behavior is preserved where appropriate.
  • Local-world, camera, input, and persistence state restore after stop/error/world change where relevant.
  • Logs, screenshots, clips, and test data contain no secrets or private information.

Documentation and migration

  • User-facing documentation updated, or no update is needed.
  • Config/clip migration reviewed, or no migration is needed.
  • Generated documentation source data updated if applicable. (Not applicable.)

AI assistance

  • AI tool(s) used: Claude Code (Claude Opus 5.5)
  • What the tool contributed: wrote the change, and ran the static verifier, Gradle test/build and the live smoke test above.
  • What I reviewed manually: the diff, with an AI-assisted review pass on 2026-10-12. Maintainer review requested.

Known limitations and follow-up work

…r tick (ThoriaDevelopment#30)

HudOverlay.render resolved the crosshair target for dwell tracking and
renderConfidencePanel resolved it again. Both panels also re-read
FlagHistory (tier, score, explanation, alerted checks, flag counts) and
rebuilt Text objects every frame.

Resolve the target once per frame and pass it down. Build a PanelModel
at most once per client tick (or on a target change) shared by the
compact panel and the hover tooltip; read the tier from the tracker's
per-tick TrackedPlayer.tier cache. Display output is unchanged, at most
one tick stale. All paths remain fail-open.

AI-assisted: Claude Code (Claude Opus 5.5) wrote the change.
Not profiled; not live-tested in runClient.
@ThoriaDevelopment
ThoriaDevelopment force-pushed the fix/hud-per-tick-panel-model branch from 2f4536f to 9a950a3 Compare October 12, 2026 18:27
@ThoriaDevelopment
ThoriaDevelopment merged commit e8671b4 into ThoriaDevelopment:main Oct 12, 2026
2 checks passed
Rgxaa added a commit to Rgxaa/Iustitia that referenced this pull request Oct 15, 2026
…lopment#37/ThoriaDevelopment#32/ThoriaDevelopment#45 conflicts)

- HudOverlay: adopt main's per-tick PanelModel architecture (ThoriaDevelopment#42); L10n
  calls already live in panelModel() from the auto-merge.
- YaclScreenBuilder: keep ThresholdBounds-aware thresholdOption (ThoriaDevelopment#32),
  add the creative-flight-exempt option via new L10n keys (ThoriaDevelopment#37).
- IustitiaCommand: keep L10n subcommand rows; update en_us presets /
  threshold texts to match ThoriaDevelopment#45/ThoriaDevelopment#23.
- verify_contribution: keep the generated-key pins (check descriptions,
  presets, keybind binds, tier labels) now that those call sites are on
  L10n.
- CONTRIBUTING: keep the full-migration wording of the user-facing-text
  section.
- lang: add iustitia.cfg.option.creativeFlightExempt.* to en_us + zh_cn.
@Rgxaa Rgxaa mentioned this pull request Oct 15, 2026
5 of 9 tasks
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.

[Bug] HUD resolves crosshair target twice per frame and rebuilds history state per frame

2 participants