Skip to content

Add Alist and Alist-backed Mlist implementation and tests#41

Merged
Bastacyclop merged 22 commits into
mainfrom
alist
Jun 30, 2026
Merged

Add Alist and Alist-backed Mlist implementation and tests#41
Bastacyclop merged 22 commits into
mainfrom
alist

Conversation

@Ultra-MG

@Ultra-MG Ultra-MG commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator
  • Add the new generic Alist chunked-array sequence structure.
  • Replace Mlist with the new Alist-backed implementation.
  • Update Mlist.empty to Mlist.empty () so each Alist-backed empty Mlist is freshly allocated instead of sharing internal structure.
  • Add Monolith-based randomized tests for Alist against a naive list-backed reference.
  • Add AFL fuzzing setup for deeper Alist testing.

@Ultra-MG Ultra-MG requested review from Bastacyclop and charguer June 2, 2026 08:03
Comment thread tests_infra/alist/input/dummy Outdated
Comment thread lib/ast/alist.ml Outdated
Comment thread lib/ast/mlist.ml

@yannilefki yannilefki left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good for me, add a very little more documentation as file header and all good.

yannilefki
yannilefki previously approved these changes Jun 15, 2026
@yannilefki yannilefki dismissed their stale review June 15, 2026 11:35

Did not review the last commit. I will try to execute the tests and benchmarks before approving again.

Comment thread benchmark/README.md
Run direct `Mlist_old` vs new `Mlist` operation benchmarks and generate plots:

```bash
./benchmark/run_mlist_bench mlist-run

@yannilefki yannilefki Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm stuck here without first calling dune build in tests_infra/mlist
I end up with the error message : Program 'tests_infra/mlist/mlist_bench.exe' not found!

After some digging, I see that even calling dune build does not resolve the issue, and I can not find a way to make this benchmark run. Even though optitrust/_build/default/tests_infra/mlist/mlist_bench.exe exists...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Running the executable manually works, so the problem might be on my side.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i think the issue comes from dune exec and the way it resolves the executable path

The script used: dune exec tests_infra/mlist/mlist_bench.exe --

On some Dune setups this is treated as a program name, i am on wsl ubuntu 22.04 so it might be different for you if you are on a different version of linux

The portable version is: dune exec ./tests_infra/mlist/mlist_bench.exe --

Same for the plot script. That might be why running the executable manually worked for you, but the script failed.

@yannilefki yannilefki left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I tried running the tests, and end up stuck running make in tests_infra/alist without monolith. You should add the package to the "dune-project" in root, or to the "dune-workplace" (I'm not sure if the second one is possible though).

@Bastacyclop

Copy link
Copy Markdown
Collaborator

@Ultra-MG thanks for the README improvements, I was able to run everything until the AFL fuzzer "Useful AFL follow-up commands". There's a missing sudo apt install parallel dependency to document.

@Bastacyclop

Copy link
Copy Markdown
Collaborator

I think there's also .gitignore rules missing for:

        modified:   tests_infra/alist/input/dummy        
        tests_infra/alist/output.WiO4/
        tests_infra/alist/output.ZmHx/
        tests_infra/alist/output/

?

@Bastacyclop Bastacyclop merged commit bfa7f21 into main Jun 30, 2026
1 check passed
@Bastacyclop Bastacyclop deleted the alist branch June 30, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants