CakeML / CakeML/cakeml

The encoders are _big_

Open
#793 1 comment 0 reactions 0 assignees View on GitHub
dev experience enhancement good first issue high reward
Dominant language
Standard ML
Stars
1.2k
Forks
104
Avg merge
2d 21h
Merged PRs (30d)
16

Description

Some numbers from a `--target=riscv --exp_cut=99999` build (9a0180e sexpr-bootstrap):

```
1069060 cml_x64Prog_x64_enc_5306
990976 cml_arm7Prog_arm7_enc_5296
938348 cml_riscvProg_riscv_enc_5348
784956 cml_arm8Prog_arm8_enc_5342
373572 cml_mipsProg_mips_enc_5352
291168 cml_ag32_enc_5324
```

Some of this is probably unavoidable with heap-allocated words but looking at the HOL input to the translator in riscvProgScript and x64ProgScript we seem to be forcing the encoders into a highly canonical form where no logic can be shared between different instructions; particularly notable are the 16 reg/imm (not)(lower, less, equal, test) cases of JumpCmp which result in 16 copies of the logic to encode a conditional jump displacement. Improving the pre-translate conversions here could make the bootstrap significantly faster with no effect whatsoever on compiling things in the logic.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the HOL input to the translator in riscvProgScript and x64ProgScript, then compare how the JumpCmp cases expand into encoder logic. Trace the pre-translate conversions and measure the resulting encoder sizes or bootstrap time. Done means reducing duplicated instruction-encoding logic without changing compilation behavior.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.