Skip to content

Verify whole-page mapped-file reservations in C# and C++ - #138

Open
konard wants to merge 4 commits into
mainfrom
issue-96-a68e5d1a301d
Open

konard wants to merge 4 commits into
mainfrom
issue-96-a68e5d1a301d

Conversation

@konard

@konard konard commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Fixes #96.
Fixes #87.

Changes

  • Use the smallest whole-page initial reservation that fits the existing file and the requested minimum, with a floor of one system page. C# bounds the required capacity before adding page padding. C++ checks the limit before narrowing to its native capacity type.
  • Build on the whole-page behavior introduced in PR #134. Bring the C++ capacity helper from PR #135 into the same PR so the two implementations and their regression coverage can be reviewed together.
  • Document the constructor rule and prepare C# package version 0.4.3 and C++ template library version 0.1.1.

Reproduction and verification

Create a file exactly two system pages long and open it using the default minimum. With 4,096-byte pages the original constructor reserved 12,288 bytes for an 8,192-byte file. The expected reservation and mapped file length are both 8,192 bytes, and the logical length stays at 8,192 bytes. The C# fixture reproduced the original 12,288-byte reservation against the constructor from bf31e5d and passed with the current constructor.

The C# and C++ fixtures test existing file sizes of zero bytes, one byte, one byte below a page, one page, one byte above a page, and two pages. They check the logical length, reservation, and on-disk length during and after mapping. They also test explicit minimums and verify that an overflowing reservation leaves the original file bytes intact.

The mapped-file interoperability workflow runs both regression fixtures and all nine C#, C++, and Rust writer/reader combinations. The fixture guide documents the local commands.

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

Issue: #96
@konard konard self-assigned this Nov 29, 2026
@konard konard changed the title [WIP] [C#] FileMappedResizableDirectMemory over-reserves when reopening a page-aligned file Verify whole-page mapped-file reservations in C# and C++ Nov 29, 2026
@konard
konard marked this pull request as ready for review November 29, 2026 20:52
@konard

konard commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Working session summary

PR #138 is ready for review and addresses both #96 and its C++ counterpart #87.

The PR builds on the rounding fix already in main and adds regression coverage in both languages for all six requested file sizes, custom minimums, and overflow. The historical C# constructor reserved 12,288 bytes for an 8,192-byte file. The current fixture verifies that it reserves exactly 8,192 bytes and preserves the file contents.

All seven checks passed, including all nine C#, C++, and Rust interoperability combinations. The 15-minute review window ended with zero findings.


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.552048

📊 Context and tokens usage:

  • 118.6K / 272K (44%) input tokens, 18.2K / 128K (14%) output tokens

Total: (118.6K + 4.0M cached) input tokens, 18.2K output tokens, $1.552048 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 (351KB)


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

1 participant