Map cells with static data for LLVM kompile#1084
Draft
mariaKt wants to merge 28 commits into
Draft
Conversation
Collaborator
Author
|
Relevant discussion on slack |
Due to it calling loopupFunction in its boby while being no-evaluators
The other callsites are TODO.
Callsites not in [no-evaluators] functions updated. Temporary syntax-only fixes for callsites inside [no-evaluators] functions.
…ets, and #elemSize. Temporary noMap fixes for the callsites in functions with [no-evaluators]
…s fixed callsites
099b940 to
6ea181d
Compare
- test_cli_prove_add_module_*: added new cells in rule in corresponding module - test_cli_show_to_module: updated expected output (three new cells expected) - test_decode_value: the LLVM definition is now shared (not per-program), so the test could not compile a per-program definition. Updated fixture to use KMIR.definition_dir directly. Also, #decodeValue now takes MaybeMap as first argument, so the Kore template and to_pattern were updated to pass the types map built from TEST_SMIR.
e4ad90c to
84f438d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a dual lookup mechanism for static data, using a
MaybeMapsort, aiming to avoid per-program LLVM kompile in concrete execution. Program-specific data (functions, types, allocations) is stored inMapcells for LLVM execution, while the existingno-evaluatorsKore functions are preserved for the Haskell/booster backend.Status
Both LLVM and Haskell backends work. Zero regressions on the LLVM UI test suite (1162/1162 baseline). Zero regressions on the Haskell prove UI test suite so far (in progress). LLVM execution ~14x faster (5.5h with 1 worker, vs ~38h with with 2 workers)
Commits
MaybeMapsort (noMap | someMap(Map)) and new<functions>,<types>,<memory>cells to the configuration.lookupFunction/lookupTy/lookupAlloctolookupFunctionKore/lookupTyKore/lookupAllocKore(keeping[no-evaluators]).lookupFunctionMap,lookupTyMap,lookupAllocMap) usingorDefaultfor missing keys.lookupFunction(MaybeMap, Ty)etc. that dispatch to Kore or Map versions.kmir.mdandrt/data.mdto read the new cells and use the wrapper functions.symbol(MaybeMap::noMap)andsymbol(MaybeMap::someMap)attributes for clean Python integration._make_smir_maps) and skip LLVMkompilein concrete execution.noMapviatop_downKORE traversal).noMapin the symbolic call config to have concrete values instead of unbound Kore variables.[function]) and symbolic ([no-evaluators]) using markdown selectors. In concrete execution, dispatch to map lookups; in symbolic execution, per-program axioms bridge tolookupXKore.lookupFunction,lookupTy,lookupAlloc, and#getBlocksto delegate from the[no-evaluators]wrapper tolookupXKorein the Haskell definition.[no-evaluators]functions that calllookupTyKoredirectly to concrete/symbolic split withMaybeMapparameter:#getBlocks,readTyConstInt,#staticArrayLenBits,getTyOf,#metadataSize,#metadataSizeAux,#typeProjection,#pointeeProjection,#pointeeProjectionTarget,getArrayElemTypeInfo,#lookupMaybeTy,#sizeOf,#alignOf,#isStaticU8Array,#convertMetadata,#projectedCallTy,#extractOperandType,#decodeValue,#neededBytesForOffsets,#decodeFieldsWithOffsets,#elemSize,#decodeEnumDirectFields,#decodeArrayAllocation,#decodeArrayElements,#decodeSliceAllocation. (multiple commits)test_decode_value,test_cli_prove_add_module_*).