diff --git a/compilers/concrete-compiler/compiler/include/concretelang/TestLib/TestProgram.h b/compilers/concrete-compiler/compiler/include/concretelang/TestLib/TestProgram.h index 6feec25d83..24ef6052d9 100644 --- a/compilers/concrete-compiler/compiler/include/concretelang/TestLib/TestProgram.h +++ b/compilers/concrete-compiler/compiler/include/concretelang/TestLib/TestProgram.h @@ -150,7 +150,10 @@ class TestProgram { Result getClientCircuit(std::string name = "main") { OUTCOME_TRY(auto lib, getLibrary()); - OUTCOME_TRY(auto ks, getKeyset()); + Keyset ks{}; + if (!isSimulation()) { + OUTCOME_TRY(ks, getKeyset()); + } auto programInfo = lib.getProgramInfo(); OUTCOME_TRY(auto clientProgram, ClientProgram::create(programInfo, ks.client, encryptionCsprng, diff --git a/compilers/concrete-compiler/compiler/tests/end_to_end_tests/end_to_end_jit_test.cc b/compilers/concrete-compiler/compiler/tests/end_to_end_tests/end_to_end_jit_test.cc index ec13275e45..3c15b16103 100644 --- a/compilers/concrete-compiler/compiler/tests/end_to_end_tests/end_to_end_jit_test.cc +++ b/compilers/concrete-compiler/compiler/tests/end_to_end_tests/end_to_end_jit_test.cc @@ -496,3 +496,18 @@ func.func @dec(%arg0: !FHE.eint<3>) -> !FHE.eint<3> { ASSERT_EQ(lambda_dec({Tensor(1)}), (uint64_t)0); ASSERT_EQ(lambda_dec({Tensor(4)}), (uint64_t)3); } + +/// https://github.com/zama-ai/concrete-internal/issues/655 +TEST(CompileAndRun, compress_input_and_simulate) { + mlir::concretelang::CompilationOptions options; + options.compressInputCiphertexts = true; + options.simulate = true; + TestProgram circuit(options); + ASSERT_OUTCOME_HAS_VALUE(circuit.compile(R"XXX( +func.func @main(%arg0: !FHE.eint<3>) -> !FHE.eint<3> { + return %arg0: !FHE.eint<3> +} +)XXX")); + ASSERT_ASSIGN_OUTCOME_VALUE(result, circuit.call({Tensor(7)})); + ASSERT_EQ(result[0].getTensor().value()[0], (uint64_t)(7)); +} \ No newline at end of file