check_ahead
nanofil also scheduled check
In Fil-C the check scheduler hoists and merges checks, filc-optimize-checks (compiler, FilPizlonator.cpp)
check_aheadLo, Hi, Rights, Align, AHi is a check of [Lo, Hi) whose own access needs only [Lo, AHi): the bytes [AHi, Hi) are checked early for later accesses through the same base, as filcc's check scheduler does. It may trap earlier than the reference program, but only on runs that would trap later anyway.
Made by
schedule:schedule_checks/2under--checks=schedule(opt-in); emitted as a plain check of the whole range.Accepted by
ir:ahead_justified/3where, right after its access, the need of P's exact base B (P = B + K) is at least K + Hi, the access is ahead-transparent, K and K + Lo are near offsets, and the function has no setjmp. Rocq:ahead_justifiedin Validate.v, read back by Ahead.v'sahead_accepted.interp.pl tests
[Lo, AHi)first and traps as a check would; if only the rest fails, the frame is doomed.
The subtlety: the bound on K + Lo came from a counterexample in which the check's start wrapped onto the need's end modulo 2^64 (rocq.md, A need past 2^64).
See schedule.md.
Linked from
- Ahead.v: exit_in
- Doomed.v: ahead_holds
- Evidence.v: access_fact
- How Fil-C works: What makes it fast enough
- Invariant.v: frame_ok
- Invariant.v: func_facts
- Machine.v: ahead_inst
- Memory.v: res
- NFB guide (Argon): Opcode map (`nfb_form/3`)
- NFB guide (Wonder): 11.2 Function bodies and instruction words
- Panics.v: failure
- Semantics.v: doomed_result
- Semantics.v: frame
- Single.v: ahead_free
- Steps.v: transparent_relies
- Syntax.v: ahead_transparent
- Syntax.v: value
- Validate.v: ahead_accepts
- Validate.v: ahead_fold
- Validate.v: ahead_insts
- Validate.v: ahead_justified
- Validate.v: checked_inst_rest
- Validate.v: facts
- Validate.v: renew_source
- Validate.v: src
- Validate.v: valid_op
- ahead-transparent
- check
- doomed frame
- live fact
- near offset
- need
- reference path
- renew source
- replay
- reuse
- scope
- the formal campaign: Campaign 4: observations, refinement, and the environment
- the formal campaign: The campaigns at a glance
- the formal campaign: What counts as a panic
- the guide: 9. Check evidence and the validator: check_reuse.pl, ir.pl
- trap