Beispiel
llvmlite 0.49.0rc1: binding.create_mcjit_compiler
Verifiziertes Beispiel für pypi llvmlite 0.49.0rc1: binding.create_mcjit_compiler. Der Vertrag lief auf python 3.12 · linux debian/x64 · docker und bestand.
sha256:f20775a4605b008c741b95d64029ea8a39cec91dd62ee0c2e50035885d5282d5
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 1
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
python 3.12 linux 24 · ubuntu · glibc 2.39 x64 python 3.12 python pip 24
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| python 3.12 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · python@1python:3.12-slim@sha256:09f7da3bc104… |
2026-09-07 |
Fall
HOW- Ziel
- verify pkg:pypi/llvmlite@0.49.0rc1
- Pakete
- Symbole
-
- llvmlite.binding.create_mcjit_compiler
- Umgebung
- python 3.12
- Erstellt
- 2026-09-07T07:02:19Z
Contract
- llvmlite.binding native target and asmprinter initialization
- llvmlite.ir.Module and IRBuilder construct typed functions with arithmetic instructions
- llvmlite.binding.parse_assembly parses IR assembly string into verified ModuleRef
- llvmlite.binding.create_mcjit_compiler compiles module and retrieves executable function pointer
Dateien
- PROMPT.md
- csx.json
- requirements.txt
- spec.json
- test/contract.py
Quelltext
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:pypi/llvmlite@0.49.0rc1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:pypi/llvmlite@0.49.0rc1
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:0894e9153d28ab0c975f32f37a3ea658a87b5b4d08bcf00a5ec5cfd1441f4c71","contract":["llvmlite.binding native target and asmprinter initialization","llvmlite.ir.Module and IRBuilder construct typed functions with arithmetic instructions","llvmlite.binding.parse_assembly parses IR assembly string into verified ModuleRef","llvmlite.binding.create_mcjit_compiler compiles module and retrieves executable function pointer"],"goal":"verify pkg:pypi/llvmlite@0.49.0rc1","kind":"HOW","packages":["pkg:pypi/llvmlite@0.49.0rc1"],"schemaVersion":1,"symbols":["llvmlite.binding.create_mcjit_compiler"]},"contractCommand":["python","test/contract.py"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"pypi","executionContext":"python","language":"python","libc":"glibc","libcVersion":"2.39","moduleSystem":"standard","os":"linux","osVersionBucket":"24","packageManager":"pip","packageManagerVersion":"24.0","runtime":"python","runtimeVersion":"3.12","schemaVersion":1},"license":"MIT-0","packages":["pkg:pypi/llvmlite@0.49.0rc1"],"schemaVersion":1,"subject":"pkg:pypi/llvmlite@0.49.0rc1","symbols":["llvmlite.binding.create_mcjit_compiler"],"verifierAdapter":"python@1"}
llvmlite==0.49.0rc1
{
"schemaVersion": 1,
"goal": "verify pkg:pypi/llvmlite@0.49.0rc1",
"kind": "HOW",
"packages": [
"pkg:pypi/llvmlite@0.49.0rc1"
],
"symbols": [
"llvmlite.binding.create_mcjit_compiler"
]
}
import ctypes
import llvmlite
import llvmlite.binding as llvm
import llvmlite.ir as ir
def test_native_initialization() -> None:
llvm.initialize_native_target()
llvm.initialize_native_asmprinter()
triple = llvm.get_default_triple()
assert isinstance(triple, str) and len(triple) > 0
def test_ir_module_builder() -> str:
module = ir.Module(name="mcjit_contract_mod")
i32 = ir.IntType(32)
func_type = ir.FunctionType(i32, [i32, i32])
func = ir.Function(module, func_type, name="compute")
block = func.append_basic_block(name="entry")
builder = ir.IRBuilder(block)
a, b = func.args
prod = builder.mul(a, b, name="prod")
result = builder.add(prod, ir.Constant(i32, 7), name="res")
builder.ret(result)
ir_str = str(module)
assert "compute" in ir_str
assert "mul" in ir_str
assert "add" in ir_str
assert "ret i32" in ir_str
return ir_str
def test_parse_assembly_and_verify(ir_str: str) -> llvm.ModuleRef:
mod = llvm.parse_assembly(ir_str)
assert mod is not None
mod.verify()
return mod
def test_create_mcjit_compiler_and_execute(mod: llvm.ModuleRef) -> None:
target = llvm.Target.from_default_triple()
target_machine = target.create_target_machine()
backing_mod = llvm.parse_assembly("")
engine = llvm.create_mcjit_compiler(backing_mod, target_machine)
assert engine is not None
engine.add_module(mod)
engine.finalize_object()
engine.run_static_constructors()
func_ptr = engine.get_function_address("compute")
assert func_ptr != 0, "Function pointer must not be null"
c_func = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_int32, ctypes.c_int32)(func_ptr)
# (5 * 6) + 7 = 37
assert c_func(5, 6) == 37
# (0 * 10) + 7 = 7
assert c_func(0, 10) == 7
def main() -> None:
test_native_initialization()
ir_str = test_ir_module_builder()
mod = test_parse_assembly_and_verify(ir_str)
test_create_mcjit_compiler_and_execute(mod)
print("All contract assertions passed successfully.")
if __name__ == "__main__":
main()
Ursprungs-Seeder
anonym