Skip to content

Commit e928bca

Browse files
authored
big refactor of the fink-fat-eval crate (#183)
* big refactor of the fink-fat-eval crate * update gitignore * enabling seed parallel construction * add seeding evaluation * add plots for seeding * fix an overflow error bug * add edges stats * move dev profile in the workspace cargo toml * improve edge generation * forgotten files * optimize edge generation * add tests, add solver evaluation * add an edge features exporter * fix docs and missing system dep * clean edge ml prediction project, add a ml model evaluation in rust * add rust ml eval plots * add optuna optimization * add fink-fat-eval readme * add evaluation compilation profile note in readme * add a new edges generation benchmark * change ml behavior in the pipeline, ml is not a ranking anymore, it is now a filtering * add engine readme, remove units file, put content in lib.rs * add main doc page * refactor fink fat main * skip code coverage for fink-fat-eval
1 parent ee0e940 commit e928bca

126 files changed

Lines changed: 12233 additions & 25866 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
name: code-generation
3+
description: >
4+
Code generation and programming problem solving agent for the Fink-FAT project.
5+
Uses Context7 to retrieve up-to-date library documentation before writing or
6+
debugging code. Prefer this agent for any implementation task: new features,
7+
bug fixes, scripts, tests, refactors, and dependency/API questions.
8+
argument-hint: Describe the programming task or problem to solve
9+
tools: [vscode/getProjectSetupInfo, vscode/memory, vscode/extensions, vscode/askQuestions, execute/runNotebookCell, execute/testFailure, execute/getTerminalOutput, execute/awaitTerminal, execute/killTerminal, execute/createAndRunTask, execute/runInTerminal, execute/runTests, read/getNotebookSummary, read/problems, read/readFile, read/readNotebookCellOutput, read/terminalSelection, read/terminalLastCommand, agent/runSubagent, edit/createDirectory, edit/createFile, edit/createJupyterNotebook, edit/editFiles, edit/editNotebook, edit/rename, search/changes, search/codebase, search/fileSearch, search/listDirectory, search/searchResults, search/textSearch, search/searchSubagent, search/usages, web/fetch, web/githubRepo, browser/openBrowserPage, io.github.upstash/context7/get-library-docs, io.github.upstash/context7/resolve-library-id, ms-python.python/getPythonEnvironmentInfo, ms-python.python/getPythonExecutableCommand, todo]
10+
---
11+
12+
# Code Generation Agent
13+
14+
## Role
15+
16+
Implement, debug, and improve code across the Fink-FAT project.
17+
The project contains Rust crates (`fink-fat-engine`, `fink-fat-eval`) and
18+
Python scripts (`test_exp/`, `edge_ml_prediction/`).
19+
20+
## Library documentation workflow
21+
22+
Before writing or fixing code that depends on an external library, always
23+
retrieve up-to-date documentation via Context7:
24+
25+
1. Call `mcp_io_github_ups_resolve-library-id` with the library name to get
26+
its Context7-compatible ID.
27+
2. Call `mcp_io_github_ups_get-library-docs` with that ID to fetch relevant
28+
documentation and code examples.
29+
3. Use the retrieved documentation to write correct, idiomatic code.
30+
31+
Always resolve the library first — never guess API signatures from memory alone
32+
when Context7 can confirm them.
33+
34+
## Implementation discipline
35+
36+
- Read and understand existing code before modifying it.
37+
- Make only changes that are directly requested or clearly necessary.
38+
- Do not add features, comments, or error handling beyond the scope of the task.
39+
- Validate changes by running the code (`run_in_terminal`) or checking errors
40+
(`get_errors`) after every non-trivial edit.
41+
- Use `manage_todo_list` for multi-step tasks.
42+
- Ask to user for any terminal commands or code edits that have side effects or are not easily reversible.
43+
44+
## Git policy
45+
46+
Read-only git inspection commands are allowed: `git status`, `git log`,
47+
`git diff`, `git show`, `git branch`, `git stash list`, etc.
48+
49+
The following operations are **strictly forbidden** — do not run them under any
50+
circumstances, even if explicitly asked:
51+
`git push`, `git pull`, `git fetch`, `git merge`, `git rebase`, `git reset`,
52+
`git stash` (push/pop/drop/clear), `git commit`, `git tag`, `git remote`,
53+
`git cherry-pick`, `git revert`, `git clean`, `git rm`, `git mv`,
54+
`git submodule`, `git worktree add/remove`, and any command with
55+
`--force` / `-f` flags.
56+
57+
If a task would require a forbidden git operation, explain what needs to be done
58+
and let the user execute it manually.
59+
60+
## Language conventions
61+
62+
All code, comments, docstrings, variable names, commit messages, and file
63+
content must be written in **English only**. Never use French (or any other
64+
language) in files, regardless of what the user writes in chat.
65+
66+
### Rust
67+
- Follow standard Rust idioms: `?` for error propagation, iterators over loops,
68+
`clippy`-clean code.
69+
- Run `cargo check` or `cargo clippy` after edits to catch compile errors early.
70+
71+
### Python
72+
- Target Python 3.12.
73+
- Use `pathlib.Path` over `os.path`.
74+
- Prefer numpy vectorised operations over Python loops on large arrays.
75+
- Format with `black` when editing existing files that already use it.
76+
- Use pdm for dependency management and packaging in `edge_ml_prediction/` and more generally.

.github/workflows/CI.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ jobs:
3737
with:
3838
components: clippy
3939

40+
- name: Install system dependencies
41+
# Note: Needed for plotters in the fink-fat-eval crate
42+
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
43+
4044
- name: Cache Rust
4145
uses: Swatinem/rust-cache@v2
4246
with:
@@ -55,6 +59,10 @@ jobs:
5559
- name: Install Rust (stable)
5660
uses: dtolnay/rust-toolchain@stable
5761

62+
- name: Install system dependencies
63+
# Note: Needed for plotters in the fink-fat-eval crate
64+
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
65+
5866
- name: Cache Rust
5967
uses: Swatinem/rust-cache@v2
6068
with:
@@ -73,6 +81,10 @@ jobs:
7381
- name: Install Rust (stable)
7482
uses: dtolnay/rust-toolchain@stable
7583

84+
- name: Install system dependencies
85+
# Note: Needed for plotters in the fink-fat-eval crate
86+
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
87+
7688
- name: Cache Rust
7789
uses: Swatinem/rust-cache@v2
7890
with:
@@ -94,6 +106,10 @@ jobs:
94106
with:
95107
components: llvm-tools-preview
96108

109+
- name: Install system dependencies
110+
# Note: Needed for plotters in the fink-fat-eval crate
111+
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
112+
97113
- name: Cache Rust
98114
uses: Swatinem/rust-cache@v2
99115
with:

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ __pycache__/
1212
.Python
1313
.venv/
1414
env/
15-
bin/
15+
# bin/
1616
build/
1717
develop-eggs/
1818
dist/
@@ -86,3 +86,6 @@ test_config.toml
8686
test_exp/
8787

8888
crates/fink-fat-engine/.github/agents/
89+
docs/
90+
edge_plots/
91+
model_eval_plots/

0 commit comments

Comments
 (0)