Skip to content

Clarify initial C++ mapped-file reservations - #135

Open
konard wants to merge 5 commits into
mainfrom
issue-87-b78d2dba7ceb
Open

konard wants to merge 5 commits into
mainfrom
issue-87-b78d2dba7ceb

Conversation

@konard

@konard konard commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Fixes #87

Changes

  • Move the initial reservation calculation into a private helper. It selects the largest of the existing file length, the caller's minimum, and one system page, then rounds up to a whole page with an overflow check before narrowing to size_t.
  • Document the rule and prepare C++ template library version 0.1.1. PR Unify the mapped-file format across C#, C++ and Rust #134 already introduced whole-page rounding for mapped-file interoperability, so this refactor preserves that behavior.

Reproduction and verification

Create a file exactly two system pages long and open it with a one-page minimum. In the local reproduction, the original constructor reserved 12,288 bytes for an 8,192-byte file, failing the new regression. With this branch, it reserved 8,192 bytes and the regression passed.

MappedFileFixture check-reservation also checks empty files, explicit minimums on both sides of page boundaries, and rejection of overflow before resizing the file.

The mapped-file interoperability workflow runs the focused C++ regression and all nine C++, C#, and Rust writer/reader combinations. The fixture instructions show how to build and run the checks locally.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #87
@konard konard self-assigned this Nov 29, 2026
@konard konard changed the title [WIP] Improve capacity calculation in FileMappedResizableDirectMemory constructor Clarify initial C++ mapped-file reservations Nov 29, 2026
@konard
konard marked this pull request as ready for review November 29, 2026 19:48
@konard

konard commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Issue #87 is implemented and ready for review in PR #135. The C++ constructor now delegates capacity calculation to a named helper that preserves whole-page rounding and rejects overflow. The C++ package version was bumped to 0.1.1.

The regression reproduced the original 12,288-byte reservation for an 8,192-byte file. The PR reserves exactly 8,192 bytes in the same case. All seven checks passed, including all nine C++, C#, and Rust interoperability combinations. The 15-minute review window closed with zero findings. PR checks


This summary was automatically extracted from the AI working session output.

@konard

konard commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-6.2 Sol
  • Provider: OpenAI
  • Public pricing estimate: $1.409302

📊 Context and tokens usage:

  • 84.9K / 272K (31%) input tokens, 19.7K / 128K (15%) output tokens

Total: (84.9K + 3.9M cached) input tokens, 19.7K output tokens, $1.409302 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-6.2-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-6.2 Sol (gpt-6.2-sol)

📎 Log file uploaded as Gist (332KB)


This AI session has ended. Monitoring of this pull request continues. Feel free to review and add feedback while checks are running.

@konard

konard commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No uncommitted changes

This branch has not been deployed

No deployments
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.

Improve capacity calculation in FileMappedResizableDirectMemory constructor

1 participant