Skip to content

fix: Decouple arch-specific constants from PagingConstsTrait trait definitions, fix specifications, and prove axioms.#532

Draft
rikosellic wants to merge 30 commits into
asterinas:mainfrom
rikosellic:paging-const
Draft

fix: Decouple arch-specific constants from PagingConstsTrait trait definitions, fix specifications, and prove axioms.#532
rikosellic wants to merge 30 commits into
asterinas:mainfrom
rikosellic:paging-const

Conversation

@rikosellic

@rikosellic rikosellic commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

The current verification design maps hard-coded x86-specific constants to the PagingConstsTrait abstraction, which is incorrect because we can never extend the proof to other architectures. The new design is to prove the properties of abstractions (e.g., CursorOwner based on PageTableConfig) purely with the const declarations in PagingConstTrait. And only use the arch-specific constants (controlled by attributes) when proving definitions instantiated with PagingConsts.

@hiroki-chen

Copy link
Copy Markdown
Collaborator

/ci-upstream-verus

@hiroki-chen hiroki-chen mentioned this pull request Jun 16, 2026
@hiroki-chen

Copy link
Copy Markdown
Collaborator

please format

@rikosellic rikosellic marked this pull request as draft June 17, 2026 03:13
@rikosellic rikosellic changed the title Fix PagingConsts axioms fix: Decouple arch-specific constants from PagingConstsTrait trait definitions, fix specifications, and prove axioms. Jun 17, 2026
@rikosellic rikosellic added the model design Model or specification of system design label Jun 17, 2026
@rikosellic

rikosellic commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

And it turns out to be a big change, because CursorOwner::inv is actually defined with the x86-specific constants. We have something like

&&& self.level <= 4 ==> {...}`
&&& self.level <= 3 ==> {....}

This is wrong because there are 3-level page tables in other architectures.

@rikosellic rikosellic added the verification bug Unsoundness, verification panics, or unsupported features label Jun 17, 2026
@rikosellic

Copy link
Copy Markdown
Collaborator Author

This PR is currently suspended.

@rikosellic

Copy link
Copy Markdown
Collaborator Author

Need to merge the latest mainbranch. Hopefully, it will not be too hard, as many changes originally proposed in this PR have been individually merged in #531 #534 #537.

Resolved conflicts between paging-const genericization and upstream
changes (PRs asterinas#531, asterinas#534, asterinas#537). Adapted upstream's new proven proofs
to use generic C::NR_LEVELS()/nr_subpage_per_huge::<C>() forms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Marsman1996 Marsman1996 added the AI-assist AI-aided proof or generation label Jun 20, 2026
@Marsman1996

Copy link
Copy Markdown
Collaborator

Reduce from 215 newly added assumes to 25 assumes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-assist AI-aided proof or generation model design Model or specification of system design verification bug Unsoundness, verification panics, or unsupported features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants