Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 45 additions & 16 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,60 @@
---
name: Bug report
about: Create a report to help us improve the 3D NAND Optimization Tool
title: '[BUG] '
about: Something is broken or produces incorrect results
title: "[BUG] "
labels: bug
assignees: ''
---

## Describe the bug
A clear and concise description of what the bug is.

## To Reproduce
Steps to reproduce the behavior:
1. Configure '...'
2. Execute '...'
3. See error
<!-- A clear and concise description of what the bug is. -->

## Expected behavior
A clear and concise description of what you expected to happen.

## Logs/Screenshots
If applicable, add logs or screenshots to help explain your problem.
<!-- What should happen? Include expected values where applicable (e.g. "WAF should be ≥ 1.0"). -->

## Actual behavior

<!-- What actually happens? Include error messages, incorrect metric values, etc. -->

## Reproduction steps

```bash
# Minimum command to reproduce
opennandlab run --config ... --workload ...
```

```python
# Or minimum Python snippet
from opennandlab import Simulator
...
```

## Environment
- OS: [e.g. Ubuntu 22.04, Windows 11]
- Python version: [e.g. 3.9.12]
- NAND Hardware (if applicable): [e.g. Simulator, Hardware XYZ]
- Version [e.g. 1.1.0]

- OpenNANDLab version: <!-- `pip show opennandlab` -->
- Python version: <!-- `python --version` -->
- OS:
- CPU/Architecture:

## Is this a correctness bug?

<!-- Tick all that apply -->

- [ ] ECC does not correct ≤ t errors
- [ ] WAF is < 1.0
- [ ] `write_page` then `read_page` returns wrong data
- [ ] GC does not free any pages
- [ ] RBER does not increase with P/E count
- [ ] Other — describe below

## Relevant log output

```
# Paste relevant log lines here
```

## Additional context
Add any other context about the problem here, such as modifications to configuration files or specific NAND parameters.

<!-- Anything else? Link to related issues or papers if this is a domain correctness question. -->
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 3D NAND Optimization Tool Discussions
url: https://github.com/muditbhargava66/3D-NAND-Flash-Storage-Optimization-Tool/discussions
url: https://github.com/muditbhargava66/OpenNANDLab/discussions
about: Please ask and answer questions here.
- name: 3D NAND Optimization Tool Documentation
url: https://github.com/muditbhargava66/3D-NAND-Flash-Storage-Optimization-Tool/blob/main/README.md
url: https://github.com/muditbhargava66/OpenNANDLab/blob/main/README.md
about: Please check the documentation before reporting issues.
48 changes: 31 additions & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
---
name: Feature request
about: Suggest an idea for the 3D NAND Optimization Tool
title: '[FEATURE] '
about: Propose a new algorithm, module, or benchmark
title: "[FEAT] "
labels: enhancement
assignees: ''
---

## Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
## Summary

## Describe the solution you'd like
A clear and concise description of what you want to happen.
<!-- One-sentence description of what you want to add. -->

## Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
## Motivation

## Which component would this feature affect?
- [ ] NAND Defect Handling
- [ ] Performance Optimization
- [ ] Firmware Integration
- [ ] NAND Characterization
- [ ] User Interface
- [ ] Other
<!-- Why is this useful? What metric does it improve (WAF, BLER, latency, lifetime)?
Link to a paper or reference if this is an algorithmic improvement. -->

## Additional context
Add any other context or screenshots about the feature request here.
## Proposed design

<!-- Describe the algorithm, data structure, or module structure you have in mind.
For new GC policies, include the scoring function.
For new ECC algorithms, include the key reference. -->

## Acceptance criteria

- [ ] All existing tests still pass
- [ ] New tests cover the new feature
- [ ] Docstrings added
- [ ] CHANGELOG.md updated
- [ ] If a new metric: documented in BENCHMARKS.md

## Priority / effort estimate

<!-- Optional: how important is this and how hard do you think it is? -->

Priority: <!-- P0 / P1 / P2 / P3 -->
Effort: <!-- Days / weeks -->

## Related issues / PRs

<!-- Link related issues or papers here. -->
90 changes: 63 additions & 27 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,66 @@
## Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
## Summary

Fixes # (issue)
<!-- One paragraph: what does this PR do and why? -->

Closes #<!-- issue number -->

---

## Type of change
Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Code refactoring (no functional changes)
- [ ] Performance improvement

## How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

- [ ] Test A
- [ ] Test B

## Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

- [ ] Bug fix — correctness issue in critical path (ECC, FTL, GC, WL)
- [ ] Feature — new module or algorithm
- [ ] Performance improvement — same correctness, faster
- [ ] Refactor — no behavior change
- [ ] Documentation
- [ ] CI / tooling

---

## Correctness checklist

For any change touching the simulator's critical path (write_page, read_page, GC, ECC):

- [ ] `write_page → read_page` round-trip returns original data
- [ ] WAF ≥ 1.0 on all workloads
- [ ] BCH corrects exactly t errors (not t-1, not t+1)
- [ ] Wear leveling stddev decreases or stays flat over time
- [ ] No placeholder comments (`# TODO`, `# ... (no implementation)`) in critical paths

---

## Test coverage

- [ ] Unit tests added for all changed modules
- [ ] Hypothesis property tests added if this touches ECC, FTL, or WL
- [ ] Integration test updated if the write/read pipeline changed
- [ ] `pytest --cov` still reports ≥ 80%

---

## Code quality

- [ ] `mypy src/` passes with 0 errors
- [ ] `ruff check src/ tests/` reports 0 issues
- [ ] All new public APIs have NumPy-style docstrings
- [ ] CHANGELOG.md updated under `[Unreleased]`
- [ ] ARCHITECTURE.md updated if the internal design changed
- [ ] BENCHMARKS.md updated if new metrics or results are introduced

---

## Performance impact

<!-- If this changes any data structure or algorithm, fill this in.
Otherwise delete this section. -->

| Operation | Before | After | Notes |
|---|---|---|---|
| Wear leveling select | O(N) | O(log N) | min-heap |

---

## Screenshots / plots

<!-- For visualization or dashboard changes, include a screenshot. -->
<!-- For ECC or reliability changes, include a BLER or RBER curve if possible. -->
13 changes: 3 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # Automatic caching
Expand All @@ -42,13 +42,6 @@ jobs:
--cov-report=xml \
--cov-report=term

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
flags: unittests
verbose: true

- name: List installed packages (debug)
run: pip list
if: always() # Runs even if previous steps fail
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
push:
branches: [ "main", "v2.0.0-dev" ]
pull_request:
branches: [ "main" ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Run tests with coverage
run: |
pytest --cov=src --cov-report=xml
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to PyPI

on:
release:
types: [published]

jobs:
pypi-publish:
name: Build and publish Python distribution to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
contents: read # For checkout

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install build tools
run: python -m pip install --upgrade pip build

- name: Build distribution
run: python -m build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ results/
*.log

# Configuration
resources/config/secret.yaml
docs/resources/config/secret.yaml
config/local.yaml
*.env
.env.*
Expand Down Expand Up @@ -158,4 +158,4 @@ backup/
*-backup

# Project-specific ignores
resources/config/secret.yaml
docs/resources/config/secret.yaml
Loading