Skip to content

feat: save region-map exploration per account - #556

Merged
zoeyrose merged 16 commits into
mainfrom
feat/account-map-exploration
Oct 8, 2026
Merged

zoeyrose merged 16 commits into
mainfrom
feat/account-map-exploration

Conversation

@zoeyrose

@zoeyrose zoeyrose commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Save region-map exploration on the server per account so all characters share discoveries and a fresh client restores that progress.

Closes #549.

Implementation / behavior

  • Record only visible public base-map cells accepted by normal MAP2 visibility. Cached client bits never grant server discoveries.
  • Store one bit per tile in a hashed map-path table, with a direct exploration session on each socket. Support 10,000 maps; unchanged tiles and idle flushes scan neither account sessions nor stored maps.
  • Persist compact account sidecars with mode-0600 atomic replacement, five-second batching and forced lifecycle saves. Allocate serialization buffers once. Retain each map's original bitfield layout without authored-map consistency checks or resets.
  • Protocol 1082 adds cached-bitfield requests and sparse changed-byte OR patches. Return only missing bits, selecting a bitmap when it is smaller, and retain queued updates under backpressure. Region requests avoid an automatic full-account replay at login.
  • Bound client exploration bitmaps to 1 MiB, which accommodates 10,000 typical 24×24 maps. Replay only bitmap bytes and set bits under a shared 65,536-unit frame budget, resume between frames, and coalesce new packets without restarting work. Duplicate active-account RESETs leave views and pending requests unchanged; account changes require reconnect.
  • Keep an optional private client cache scoped to the actual connection certificate and authenticated account. Load it across restarts, request relevant region paths, and refresh asynchronous assets and open map views. Disconnect hides the cache and saves received discoveries.

Validation

  • Protocol generation, all 11 protocol tests, 19 version metadata tests, 33 dependency tests, import-history verification and diff checks passed.
  • Server coverage: all 52 selected CTests passed. Server sanitizer: all 53 selected CTests passed, including leak smoke.
  • Client coverage and sanitizer: 52 CTests passed in each run; 16 GPU fixtures were skipped in the headless worker and remain covered by the required trusted GPU CI job.
  • Security regressions cover the 10,000-map sparse oversized attack, dense replay budgets, packet/asset callbacks that cannot bypass the frame budget, duplicate RESET idempotence, reconnect restoration, 10,000 typical-map cache round trips, and shared popup fog zooms.
  • Tests cover shared accounts, persistence and failed saves, malformed requests/patches, forged cache isolation, sparse reconciliation, queue backpressure, client identity isolation, disk cache round trips, and asynchronous region rendering.
  • Scale tests load/save 10,000 maps at both 24×24 and 256×256. Stores occupy 930,008 and 82,130,008 bytes respectively. Deterministic operation counters prove that idle flushes and repeated discoveries perform no store-wide or global-session scans.
  • Final independent integrated review passed through e2ba0c31eb162756645f011d8cb135baff4b23ec.
  • Fenced wrapper builds passed all 54 server CTests and all 52 headless client CTests, with the same 16 GPU fixtures deferred to trusted GPU CI.
  • Live certificate-pinned QUIC acceptance increased exploration from 136 to 144 tiles using sparse patches, with no full-map movement retransmits. Warm-cache requests sent no extra discovery data; missing cached bits reconciled and forged cache bits granted nothing. Fresh clients, a second character and an orderly server restart restored progress. The isolated topology and worker stopped cleanly.
  • Required Classic validation, CodeQL validation and Conventional PR title checks passed at e2ba0c31eb162756645f011d8cb135baff4b23ec.

Limitations / follow-up

Old per-character client-maps/*.tiles files remain untouched and are not imported. Exact-version negotiation requires protocol 1082 on both peers. An abrupt crash can lose the most recent five-second unsaved server batch. Full account saves are linear in the stored bitfields and occur only at persistence boundaries. Large client exploration histories appear progressively over frames; records beyond the client bitmap limit are rejected without evicting accepted discoveries.

The persistence, wire bounds, ownership and cache contract is documented in server/doc/REGION_EXPLORATION.md.

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

@zoeyrose
zoeyrose marked this pull request as ready for review October 2, 2026 06:40
@zoeyrose

zoeyrose commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T00:51:27.761576Z 213abb2 Manual request
🔒 Security Review ✅ Completed 2026-10-05T00:50:52.668966Z 213abb2 Manual request

Security findings

Advisory findings (2)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 632ac7b054

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread server/src/server/exploration.c Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 632ac7b054

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread server/src/server/exploration.c Outdated
@zoeyrose
zoeyrose marked this pull request as draft October 2, 2026 15:38
@zoeyrose
zoeyrose marked this pull request as ready for review October 2, 2026 15:51
@zoeyrose

zoeyrose commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: c612b82f43

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: c612b82f43

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread client/src/client/region_map.c Outdated
zoeyrose and others added 2 commits October 2, 2026 18:22
Preserve account exploration alongside current rendering, recording, and
checked shutdown behavior. Propagate exploration sidecar save failures
before administrative shutdown completion and cover active and detached
account failures with regression tests.
@zoeyrose

zoeyrose commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 213abb2953

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 213abb2953

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Keep builds, tests, GPU coverage execution and TLS verification required.
Treat external Codecov report-processing failures as non-blocking, as approved.

Validation: 44 workflow contract tests, actionlint, import history, whitespace,
and independent review passed.
Preserve access-code authentication and exploration with distinct protocol commands.
Fix output queue accounting for sensitive access packets and cover mixed producers.
Resolve the CI workflow conflict by preserving main's informational Codecov reporting.
@zoeyrose
zoeyrose merged commit 2037de7 into main Oct 8, 2026
25 checks passed
@zoeyrose
zoeyrose deleted the feat/account-map-exploration branch October 8, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Map exploration should be saved per-account

1 participant