-
Notifications
You must be signed in to change notification settings - Fork 35
Add comprehensive .github/copilot-instructions.md for repository onboarding #201
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: ahuber21 <9201869+ahuber21@users.noreply.github.com>
Co-authored-by: ahuber21 <9201869+ahuber21@users.noreply.github.com>
|
The many code changes you added suggest a problem with |
Co-authored-by: ahuber21 <9201869+ahuber21@users.noreply.github.com>
ahuber21
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot address these comments to improve the instructions.
.github/copilot-instructions.md
Outdated
| │ │ ├── vamana/ # Vamana graph index | ||
| │ │ ├── flat/ # Flat (brute-force) index | ||
| │ │ └── inverted/ # Inverted index (IVF) | ||
| │ ├── orchestrators/ # High-level APIs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot It may be useful to mention that type-erasure is used to provide simple and consistent interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in commit bd187f6. Updated orchestrators description to mention that they use type-erasure to provide simple and consistent interfaces.
.github/copilot-instructions.md
Outdated
| │ │ └── inverted/ # Inverted index (IVF) | ||
| │ ├── orchestrators/ # High-level APIs | ||
| │ ├── quantization/ # Vector quantization | ||
| │ └── extensions/ # ISA-specific optimizations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot extensions are more general than ISA-specific optimizations. They provide svs_invoke overloads/specializations to hook into core SVS routines. I suggest you investigate this behavior more carefully and include it in the instructions.
The concept is similar to std::invoke.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit bd187f6. Changed the extensions description to explain that they provide svs_invoke overloads/specializations to hook into core SVS routines (similar to std::invoke). Also added this as a key principle in the Important Notes section.
.github/copilot-instructions.md
Outdated
| 2. **pre-commit.yml**: Verifies code formatting with clang-format 15 | ||
| 3. **cibuildwheel.yml**: Builds Python wheels (uses custom manylinux2014 container) | ||
|
|
||
| **To replicate CI locally**: Use the exact cmake command from `build-linux.yml` (lines 70-77). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not safe to reference exact lines as files can change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit bd187f6. Removed all specific line number references from the instructions.
.github/copilot-instructions.md
Outdated
|
|
||
| ### Build Issues | ||
|
|
||
| 1. **Problem**: CMake configuration warns about unused `SVS_EXPERIMENTAL_LEANVEC` variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SVS_EXPERIMENTAL_LEANVEC is part of the closed-source part of the repository. We can completely eliminate it from this repository to avoid confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in commit bd187f6. Eliminated all references to SVS_EXPERIMENTAL_LEANVEC from build commands and explanatory notes.
.github/copilot-instructions.md
Outdated
| cd build/tests && ./tests --list-tags | ||
|
|
||
| # Clean and rebuild | ||
| rm -rf build && mkdir build && cd build && cmake .. && make -j$(nproc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This drops the cmake configuration and uses default values. You should update it to use the exact cmake configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit bd187f6. Updated the Quick Reference section to use the exact cmake configuration with all required flags.
.github/copilot-instructions.md
Outdated
| 1. **Trust these instructions first** - Only search the repository if information here is incomplete or incorrect | ||
| 2. **Always build out-of-source** - Use a `build/` directory, never configure CMake in the repository root | ||
| 3. **Follow the CI configuration** - Use the same cmake flags as `.github/workflows/build-linux.yml` for consistency | ||
| 4. **Format before committing** - Run `./tools/clang-format.sh clang-format` to avoid CI failures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the following (you are allowed to reword): Limit formatting to modified files, don't include formatting changes from other files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in commit bd187f6. Updated the formatting guidance to emphasize: "Only format files you modify; do not include formatting changes from other files in your PR".
.github/copilot-instructions.md
Outdated
| 7. **ISA dispatching** - Runtime dispatch means the same binary runs on different CPU architectures | ||
| 8. **Test filters are your friend** - Use Catch2 tags to run subsets of tests during development | ||
| 9. **Python bindings are specialized** - Changes to template parameters may require Python binding updates | ||
| 10. **Version is synchronized** - Keep version in sync across `CMakeLists.txt` (line 26), `setup.py` (line 43), and test files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add that new features and bugfixes must be accompanied by tests.
Especially a bug must first be reproduced in a unit test, and then addressed and fixed in a code change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in commit bd187f6. Added a new principle: "Tests are required - New features and bugfixes must be accompanied by tests. For bugs, first reproduce the issue in a unit test, then fix it in the code".
Co-authored-by: ahuber21 <9201869+ahuber21@users.noreply.github.com>
All review comments addressed in commit bd187f6. Changes include:
|
|
@copilot it feels like you took my suggestions verbatim. Did you reference them against your understanding of the project? Can you improve the description further? Remember, doing a good job can SIGNIFICANTLY improve the quality of the agent's work. |
Co-authored-by: ahuber21 <9201869+ahuber21@users.noreply.github.com>
Enhanced in commit d4f1061. I studied the codebase architecture more deeply and rewrote descriptions based on actual understanding rather than surface-level observations: Key improvements:
The instructions now reflect understanding of design patterns and architectural decisions, not just listing features. |
|
@copilot add another policy: if content was added on behalf of Intel employees, the following line must be added in the file header |
Co-authored-by: ahuber21 <9201869+ahuber21@users.noreply.github.com>
... Added in commit a8853bb. The policy is now included as item #7 in the Important Notes for Coding Agents section, instructing agents to add the attribution line to file headers when content is created on behalf of Intel employees. |
|
Might be worth considering not legacy monolithic instruction file but scope limited individual instructions in instructions folder - this can allow reduced context use for specific topic - this can be done on per folder or per type - for instance python API might be separate instruction , build system might be separate instruction, and C++ might be separate instruction , rest of CI and validation might be separate as well. |
ethanglaser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple minor comments, looks great though
|
|
||
| ### Prerequisites | ||
| - CMake 3.21 or higher | ||
| - C++20 compiler: GCC 11+, GCC 12+, or Clang 15+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - C++20 compiler: GCC 11+, GCC 12+, or Clang 15+ | |
| - C++20 compiler: GCC 11+ or Clang 15+ |
| │ │ ├── build-linux.yml # Main build & test (Ubuntu 22.04, g++/clang) | ||
| │ │ ├── pre-commit.yml # Format checking | ||
| │ │ ├── cibuildwheel.yml # Python wheel building | ||
| │ │ └── build-*.y{a}ml # macOS, ARM builds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't notice there was inconsistencies here. Maybe makes sense to change to .yml and revise file name (build-macos.yml) in this PR.
Add comprehensive .github/copilot-instructions.md for repository onboarding
Summary
Created comprehensive copilot-instructions.md (313 lines, ~2 pages) with verified build/test instructions.
Latest updates: Enhanced all descriptions based on deep architectural understanding of the codebase:
svs::Vamanawrapping templatedVamanaIndex)svs_invokeas customization point objects enabling type-specific behavior specialization without modifying core algorithmsThe instructions now reflect genuine understanding of design patterns and architectural decisions, not just surface-level feature listings.
Original prompt
Your task is to "onboard" this repository to Copilot coding agent by adding a .github/copilot-instructions.md file in the repository that contains information describing how a coding agent seeing it for the first time can work most efficiently.
You will do this task only one time per repository and doing a good job can SIGNIFICANTLY improve the quality of the agent's work, so take your time, think carefully, and search thoroughly before writing the instructions.
- Reduce the likelihood of a coding agent pull request getting rejected by the user due to generating code that fails the continuous integration build, fails a validation pipeline, or having misbehavior. - Minimize bash command and build failures. - Allow the agent to complete its task more quickly by minimizing the need for exploration using grep, find, str_replace_editor, and code search tools. - Instructions must be no longer than 2 pages. - Instructions must not be task specific.Add the following high level details about the codebase to reduce the amount of searching the agent has to do to understand the codebase each time:
Additional details that you may incorporate:
Add information about how to build and validate changes so the agent does not need to search and find it each time.
Additional details you may incorporate:
./tests/tests. Filters on CATCH_TEST_CASE names can be applied, e.g../tests/tests [integration][build].List key facts about the layout and architecture of the codebase to help the agent find where to make changes with minimal searching.
of configuration files for linting, compilation, testing, and preferences.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.