Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stdlib test importing every stdlib module #795

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

jiribenes
Copy link
Contributor

@jiribenes jiribenes commented Jan 23, 2025

Resolves #614.

I'm pretty sure this will reveal at least two bugs. :)
EDIT: Yep, three different libraries didn't even compile. 😠
EDIT 2: Aaaand, there are two different miscomputations on LLVM! 😆 So 5 bugs altogether so far.

ACME in our context stands for "All Common Modules in Effekt" :)

@jiribenes
Copy link
Contributor Author

jiribenes commented Jan 23, 2025

Ideal follow-up: make CI so that on change in /libraries/common/, we check that the acme.effekt file contains every module in that folder, recursively (just generate it again and diff). If not, fail and spam the PR.
EDIT: Done. ACME CI now exists.

@jiribenes
Copy link
Contributor Author

New LLVM bugs, cc @phischu:

$ EFFEKT_DEBUG=1 effekt --backend=llvm --ir-write-all --debug --optimize examples/stdlib/json.effekt
opt: ./out/json.ll:4001:9: error: multiple definition of local value named 'd_24_132_3_22162'
        %d_24_132_3_22162 = insertvalue %Neg %vtable_temporary_865, %Object %closure_861, 1
        ^

$ EFFEKT_DEBUG=1 effekt --backend=llvm --ir-write-all --debug --optimize examples/stdlib/buffer.effekt
Instruction does not dominate all uses!
  %buffer_24_4387 = insertvalue %Neg %vtable_temporary_1257, ptr %closure_1239, 1
  call void @shareNegative(%Neg %buffer_24_4387)
Instruction does not dominate all uses!
  %buffer_24_4387 = insertvalue %Neg %vtable_temporary_1257, ptr %closure_1239, 1
  store %Neg %buffer_24_4387, ptr %buffer_24_4387_pointer_1255, align 8, !noalias !0
Instruction does not dominate all uses!
  %buffer_24_4387 = insertvalue %Neg %vtable_temporary_1257, ptr %closure_1239, 1
  call void @eraseNegative(%Neg %buffer_24_4387)
opt: ./out/buffer.ll: error: input module is broken!

val result: T = contents.remove(head).getOrElse { <> };
val result: T = contents.unsafeGet(head);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is semantically correct, we use it as a circular buffer, so we don't really need to invalidate the previous value -- we'd have overwritten it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a test that loads all stdlib files
1 participant