Skip to content

.397395619494580:b4c25d9e12d0a7b28f38c42200eac686_69e6210c180bcf8a442e5ffe.69e62f33180bcf8a442e60e0.69e62f33966af563bdeec990:Trae CN.T(2026/4/20 21:50:43)#116

Open
yangou-hash wants to merge 4 commits intotaichi-dev:masterfrom
yangou-hash:ouyu_trae_4
Open

.397395619494580:b4c25d9e12d0a7b28f38c42200eac686_69e6210c180bcf8a442e5ffe.69e62f33180bcf8a442e60e0.69e62f33966af563bdeec990:Trae CN.T(2026/4/20 21:50:43)#116
yangou-hash wants to merge 4 commits intotaichi-dev:masterfrom
yangou-hash:ouyu_trae_4

Conversation

@yangou-hash
Copy link
Copy Markdown

@yangou-hash yangou-hash commented Apr 20, 2026

Note

Medium Risk
Adds new force application logic into the MPM solver’s per-step grid_postprocess pipeline, which can affect all simulations. The PR also vendors large third-party local_packages content, increasing repo size and potential dependency/supply-chain review surface.

Overview
Adds a new MPMSolver.add_wind_field() API that applies a constant directional force to grid velocities within an axis-aligned bounding box each substep via the existing grid_postprocess hook.

Updates demo_3d.py to run CPU-first, adjusts sys.path to load project and local_packages, and demonstrates the new wind field; adds two new wind-field demo/test scripts (test_wind_field.py and wind_field_visual_test.py) to validate and visualize particle drift.

Vendors a local_packages directory including colorama and dill (plus helper binaries), introducing a large amount of third-party code into the repository.

Reviewed by Cursor Bugbot for commit 4223b17. Bugbot is set up for automated code reviews on this repo. Configure here.

实现风场效果功能,允许在特定区域内施加风力。新增add_wind_field方法,通过指定区域边界和风力向量来创建风场效果,并在网格后处理阶段应用风力影响。
本次提交新增了多个Python包和工具模块,包括numpy、taichi、rich、markdown_it等核心库及其相关依赖。主要包含以下内容:

1. 新增numpy核心库及其类型检查、测试工具
2. 添加taichi图形计算框架及其UI、数学、线性代数模块
3. 引入rich终端格式化输出库
4. 集成markdown_it Markdown解析器
5. 包含colorama、pygments等辅助工具
6. 添加各类测试用例和示例代码
7. 完善构建配置和文档说明

这些新增内容为项目提供了强大的科学计算、图形渲染和文档处理能力。
添加新的风场可视化测试脚本 wind_field_visual_test.py,包含完整的粒子模拟和交互界面
修改 test_wind_field.py 配置,忽略警告并设置日志级别为 ERROR
将多个demo文件中的导入路径处理方式统一重构,提取project_root和local_packages变量,使代码更清晰易维护
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 4223b17. Configure here.

Comment thread demo/demo_3d.py
# Try to run on GPU
ti.init(arch=ti.cuda, device_memory_GB=4.0)
# Try to run on CPU (for testing)
ti.init(arch=ti.cpu)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Demo changed from CUDA to CPU for testing

Medium Severity

The ti.init(arch=ti.cuda, device_memory_GB=4.0) call was replaced with ti.init(arch=ti.cpu) and the comment explicitly says "(for testing)". Every other demo in the repository (demo_2d.py, demo_2d_snowball.py, benchmark.py, etc.) uses ti.cuda. This looks like a local testing change that was accidentally included in the commit.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4223b17. Configure here.

stats = pstats.Stats(f_prof, stream=sys.stdout)
stats.strip_dirs().sort_stats('cumtime')
stats.print_stats(20) #XXX: save to file instead of print top 20?
os.remove(f_prof)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Vendored packages with local paths committed to repo

Medium Severity

The entire local_packages/ directory containing vendored copies of colorama (0.4.6) and dill (0.4.1) — including dist-info, tests, .pyc cache references, and scripts with a Windows-specific shebang (#!E:\ProgramFiles\Anaconda\python.exe) — was committed. This is a local development environment artifact. These dependencies belong in requirements.txt and installed via pip, not checked into the repository.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4223b17. Configure here.

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.

1 participant