From df66fa15e486832c358017f38dc6c7c249f6e3d9 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 20:24:09 -0700 Subject: [PATCH 01/11] markdown link check --- .github/workflows/check_markup_links.yml | 14 ++++++++++++++ .../scripts_new/markdown-link-check-config.json | 17 +++++++++++++++++ .../workflows/scripts_new/run_markup_check.sh | 8 ++++++++ .gitignore | 1 + 4 files changed, 40 insertions(+) create mode 100644 .github/workflows/check_markup_links.yml create mode 100644 .github/workflows/scripts_new/markdown-link-check-config.json create mode 100644 .github/workflows/scripts_new/run_markup_check.sh diff --git a/.github/workflows/check_markup_links.yml b/.github/workflows/check_markup_links.yml new file mode 100644 index 0000000000..f71cb5fd25 --- /dev/null +++ b/.github/workflows/check_markup_links.yml @@ -0,0 +1,14 @@ +name: Check markup links +on: + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '14' + - name: Run markup check + run: | + bash .github/workflows/scripts_new/run_markup_check.sh diff --git a/.github/workflows/scripts_new/markdown-link-check-config.json b/.github/workflows/scripts_new/markdown-link-check-config.json new file mode 100644 index 0000000000..482a520d4d --- /dev/null +++ b/.github/workflows/scripts_new/markdown-link-check-config.json @@ -0,0 +1,17 @@ +{ + "ignorePatterns": [ + ], + "replacementPatterns": [ + { + "pattern": "^/", + "replacement": "{{BASEURL}}/" + } + ], + "httpHeaders": [ + ], + "timeout": "20s", + "retryOn429": true, + "retryCount": 5, + "fallbackRetryDelay": "30s", + "aliveStatusCodes": [200, 206] +} diff --git a/.github/workflows/scripts_new/run_markup_check.sh b/.github/workflows/scripts_new/run_markup_check.sh new file mode 100644 index 0000000000..1e7cf98ca3 --- /dev/null +++ b/.github/workflows/scripts_new/run_markup_check.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -ex +set -o pipefail + +npm i --global -D markdown-link-check + +find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check -q -c .github/workflows/scripts_new/markdown-link-check-config.json diff --git a/.gitignore b/.gitignore index d2a3084363..48682419c4 100644 --- a/.gitignore +++ b/.gitignore @@ -81,6 +81,7 @@ _build !.github/**/*.yml *.dot *.json +!.github/workflows/scripts_new/*.json !tests/**/*.json !docs/**/*.json imgui.ini From 366472a4011e3238fe1d14a4c4a9eda362d38e88 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 20:26:47 -0700 Subject: [PATCH 02/11] variation on check markdown --- .github/workflows/check_markup_links.yml | 26 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check_markup_links.yml b/.github/workflows/check_markup_links.yml index f71cb5fd25..d581a179f5 100644 --- a/.github/workflows/check_markup_links.yml +++ b/.github/workflows/check_markup_links.yml @@ -2,13 +2,23 @@ name: Check markup links on: workflow_dispatch: jobs: - build: + markdown-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '14' - - name: Run markup check - run: | - bash .github/workflows/scripts_new/run_markup_check.sh + - uses: actions/checkout@v4 + - uses: tcort/github-action-markdown-link-check@v1 + +# name: Check markup links +# on: +# workflow_dispatch: +# jobs: +# build: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: actions/setup-node@v4 +# with: +# node-version: '14' +# - name: Run markup check +# run: | +# bash .github/workflows/scripts_new/run_markup_check.sh From f5581d146faa383fcb99e71e896982eb4a3df26e Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 20:32:51 -0700 Subject: [PATCH 03/11] migraet to simpler markup check --- .github/workflows/check_markup_links.yml | 3 +++ .../scripts_new/markdown-link-check-config.json | 17 ----------------- .../workflows/scripts_new/run_markup_check.sh | 8 -------- .gitignore | 1 - 4 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/scripts_new/markdown-link-check-config.json delete mode 100644 .github/workflows/scripts_new/run_markup_check.sh diff --git a/.github/workflows/check_markup_links.yml b/.github/workflows/check_markup_links.yml index d581a179f5..ada877ecc3 100644 --- a/.github/workflows/check_markup_links.yml +++ b/.github/workflows/check_markup_links.yml @@ -7,6 +7,9 @@ jobs: steps: - uses: actions/checkout@v4 - uses: tcort/github-action-markdown-link-check@v1 + with: + folder-path: 'docs' + file-path: README.md # name: Check markup links # on: diff --git a/.github/workflows/scripts_new/markdown-link-check-config.json b/.github/workflows/scripts_new/markdown-link-check-config.json deleted file mode 100644 index 482a520d4d..0000000000 --- a/.github/workflows/scripts_new/markdown-link-check-config.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "ignorePatterns": [ - ], - "replacementPatterns": [ - { - "pattern": "^/", - "replacement": "{{BASEURL}}/" - } - ], - "httpHeaders": [ - ], - "timeout": "20s", - "retryOn429": true, - "retryCount": 5, - "fallbackRetryDelay": "30s", - "aliveStatusCodes": [200, 206] -} diff --git a/.github/workflows/scripts_new/run_markup_check.sh b/.github/workflows/scripts_new/run_markup_check.sh deleted file mode 100644 index 1e7cf98ca3..0000000000 --- a/.github/workflows/scripts_new/run_markup_check.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -ex -set -o pipefail - -npm i --global -D markdown-link-check - -find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check -q -c .github/workflows/scripts_new/markdown-link-check-config.json diff --git a/.gitignore b/.gitignore index 48682419c4..d2a3084363 100644 --- a/.gitignore +++ b/.gitignore @@ -81,7 +81,6 @@ _build !.github/**/*.yml *.dot *.json -!.github/workflows/scripts_new/*.json !tests/**/*.json !docs/**/*.json imgui.ini From 86931c85e583b5934eda54bfc5ea0ab5fcaa24e3 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 21:05:10 -0700 Subject: [PATCH 04/11] check lins on push --- .github/workflows/check_markup_links.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check_markup_links.yml b/.github/workflows/check_markup_links.yml index ada877ecc3..45e218a074 100644 --- a/.github/workflows/check_markup_links.yml +++ b/.github/workflows/check_markup_links.yml @@ -1,5 +1,8 @@ name: Check markup links on: + pull_request: + branches: + - main workflow_dispatch: jobs: markdown-link-check: From 1d48528887d862e584e976122b928765deb006bd Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 21:25:35 -0700 Subject: [PATCH 05/11] fix some links --- docs/lang/articles/contribution/dev_install.md | 6 +++--- docs/lang/articles/contribution/doc_writing.md | 2 +- docs/lang/articles/glossary/glossary.md | 8 ++++---- .../differences_between_taichi_and_python_programs.md | 2 +- docs/lang/articles/reference/operator.md | 4 +--- docs/lang/articles/reference/simt.md | 3 --- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/docs/lang/articles/contribution/dev_install.md b/docs/lang/articles/contribution/dev_install.md index 2133271dd0..082734a084 100644 --- a/docs/lang/articles/contribution/dev_install.md +++ b/docs/lang/articles/contribution/dev_install.md @@ -22,10 +22,10 @@ See the [Get Started](https://docs.taichi-lang.org/) for more information on qui This installation guide covers the following: - [Prerequisites for building Taichi from source](#prerequisites) - - [Installing optional dependencies](#install-optional-dependencies) - - [Building Taichi from source](#build-taichi-from-source) + - [Installing optional dependencies](#Install-optional-dependencies) + - [Building Taichi from source](#Build-Taichi-from-source) - [List of TAICHI_CMAKE_ARGS](#list-of-taichi_cmake_args) - - [Usage and behavior of `build.py`](#usage-and-behavior-of-buildpy) + - [Usage and behavior of `build.py`](#Design-goals-behaviors-and-usage-of-buildpy) - [Troubleshooting and debugging](#troubleshooting-and-debugging) - [Frequently asked questions](#frequently-asked-questions) diff --git a/docs/lang/articles/contribution/doc_writing.md b/docs/lang/articles/contribution/doc_writing.md index 8602138950..d15bc1d894 100644 --- a/docs/lang/articles/contribution/doc_writing.md +++ b/docs/lang/articles/contribution/doc_writing.md @@ -62,7 +62,7 @@ def paint(t: float): ## Cross-references -To link to another section within the same article, you would use `[Return to ## 1. Code blocks](#1-code-blocks)`: [Return to ## 1. Code blocks](#1-code-blocks). +To link to another section within the same article, you would use `[Return to ## 1. Code blocks](#1-code-blocks)`: [Return to ## 1. Code blocks](#code-blocks). We follow the best practices suggested by [Docusaurus](https://docusaurus.io/docs/markdown-features/links) to cross-reference other documents, so to link to sections in other articles, please use the following relative-path based syntax, which is docs-versioning and IDE/GitHub friendly: diff --git a/docs/lang/articles/glossary/glossary.md b/docs/lang/articles/glossary/glossary.md index c338140048..76a9ecaf0b 100644 --- a/docs/lang/articles/glossary/glossary.md +++ b/docs/lang/articles/glossary/glossary.md @@ -24,7 +24,7 @@ sidebar_position: 5 -See also [structure of arrays](./glossary.md/#structure-of-arrays-soa). +See also [structure of arrays](#structure-of-arrays-soa). ## Assert statement @@ -50,7 +50,7 @@ See also [structure of arrays](./glossary.md/#structure-of-arrays-soa). -See also [row-major order](./glossary.md/#row-major-order). +See also [row-major order](#row-major-order). ## Compound type @@ -176,7 +176,7 @@ The Python scope corresponds to the host side in CUDA. -See also [coloum-major order](./glossary.md/#column-major-order). +See also [coloum-major order](#column-major-order). ## Shader storage buffer object (SSBO) @@ -200,7 +200,7 @@ A static scope is a scope of the argument of `ti.static`, which is a hint for th -See also [array of structures](./glossary.md/#array-of-structures-aos). +See also [array of structures](#array-of-structures-aos). ## Taichi function diff --git a/docs/lang/articles/reference/differences_between_taichi_and_python_programs.md b/docs/lang/articles/reference/differences_between_taichi_and_python_programs.md index 9a41c797ac..cb8bc4cabe 100644 --- a/docs/lang/articles/reference/differences_between_taichi_and_python_programs.md +++ b/docs/lang/articles/reference/differences_between_taichi_and_python_programs.md @@ -6,7 +6,7 @@ sidebar_position: 5 Although Taichi uses Python as the frontend, it follows a different set of rules in many aspects, including: -1. [Taichi only supports return statement outside non-static `if`/`for`/`while` scope in the program](#return-statement) +1. [Taichi only supports return statement outside non-static `if`/`for`/`while` scope in the program](#return-statement-and-return-type-annotation) 2. [Variables defined inside an `if`/`for`/`while` block cannot be accessed outside the block.](#variable-scoping) 3. [Taichi does not fully support some language features of Python.](#unsupportedpartially-supported-python-language-features) diff --git a/docs/lang/articles/reference/operator.md b/docs/lang/articles/reference/operator.md index 16a9aa5e83..a6972ac2dd 100644 --- a/docs/lang/articles/reference/operator.md +++ b/docs/lang/articles/reference/operator.md @@ -56,9 +56,7 @@ Python3 distinguishes `/` (true division) and `//` (floor division), e.g., `1.0 operands to the default integral type. To avoid such implicit casting, you can manually cast your operands to -desired types, using `ti.cast`. Please see -[Default precisions](#default-precisions) for more details on -default numerical types. +desired types, using `ti.cast`. Taichi also provides `ti.raw_div` function which performs true division if one of the operands is floating point type and performs floor division if both operands are integral types. diff --git a/docs/lang/articles/reference/simt.md b/docs/lang/articles/reference/simt.md index e4fd41986a..b66e729e0e 100644 --- a/docs/lang/articles/reference/simt.md +++ b/docs/lang/articles/reference/simt.md @@ -27,9 +27,6 @@ similar to the [usage in CUDA kernels](https://developer.nvidia.com/blog/using-c |`ti.simt.warp.active_mask` | `__activemask` | |`ti.simt.warp.sync` | `__syncwarp` | -See [Taichi's API reference](https://docs.taichi-lang.org/api/taichi/lang/simt/warp/#module-taichi.lang.simt.warp) -for more information on each function. - Here is an example of performing data exchange within a warp in Taichi: From 8eba89c12e1e6b7eb37dfd875d8d7b56c74f85d2 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 22:17:30 -0700 Subject: [PATCH 06/11] check modified files only --- .github/workflows/check_markup_links.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/check_markup_links.yml b/.github/workflows/check_markup_links.yml index 45e218a074..2cd356a12f 100644 --- a/.github/workflows/check_markup_links.yml +++ b/.github/workflows/check_markup_links.yml @@ -13,18 +13,4 @@ jobs: with: folder-path: 'docs' file-path: README.md - -# name: Check markup links -# on: -# workflow_dispatch: -# jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: actions/setup-node@v4 -# with: -# node-version: '14' -# - name: Run markup check -# run: | -# bash .github/workflows/scripts_new/run_markup_check.sh + check-modified-files-only: yes From 3ce69b978f85eaf68b7924b3171b930a59b8f042 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 22:19:21 -0700 Subject: [PATCH 07/11] base branch main --- .github/workflows/check_markup_links.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check_markup_links.yml b/.github/workflows/check_markup_links.yml index 2cd356a12f..6cf80291c3 100644 --- a/.github/workflows/check_markup_links.yml +++ b/.github/workflows/check_markup_links.yml @@ -14,3 +14,4 @@ jobs: folder-path: 'docs' file-path: README.md check-modified-files-only: yes + base-branch: main From fd64f2bae86af41006c4e4f28d34ae4ddcd06f1a Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 22:21:42 -0700 Subject: [PATCH 08/11] revert dev_install.md --- docs/lang/articles/contribution/dev_install.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/lang/articles/contribution/dev_install.md b/docs/lang/articles/contribution/dev_install.md index 082734a084..2133271dd0 100644 --- a/docs/lang/articles/contribution/dev_install.md +++ b/docs/lang/articles/contribution/dev_install.md @@ -22,10 +22,10 @@ See the [Get Started](https://docs.taichi-lang.org/) for more information on qui This installation guide covers the following: - [Prerequisites for building Taichi from source](#prerequisites) - - [Installing optional dependencies](#Install-optional-dependencies) - - [Building Taichi from source](#Build-Taichi-from-source) + - [Installing optional dependencies](#install-optional-dependencies) + - [Building Taichi from source](#build-taichi-from-source) - [List of TAICHI_CMAKE_ARGS](#list-of-taichi_cmake_args) - - [Usage and behavior of `build.py`](#Design-goals-behaviors-and-usage-of-buildpy) + - [Usage and behavior of `build.py`](#usage-and-behavior-of-buildpy) - [Troubleshooting and debugging](#troubleshooting-and-debugging) - [Frequently asked questions](#frequently-asked-questions) From 8da7cd8917341249387a973f08c1b7c104cf043a Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 22:25:22 -0700 Subject: [PATCH 09/11] change verbsoity --- .github/workflows/check_markup_links.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check_markup_links.yml b/.github/workflows/check_markup_links.yml index 6cf80291c3..66b04876f6 100644 --- a/.github/workflows/check_markup_links.yml +++ b/.github/workflows/check_markup_links.yml @@ -15,3 +15,5 @@ jobs: file-path: README.md check-modified-files-only: yes base-branch: main + use-quiet-mode: yes + use-verbose-mode: yes From 3d6e3e1f179d73ddb53fac70a0c92022d1d48495 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Mon, 2 Jun 2025 22:26:05 -0700 Subject: [PATCH 10/11] revert file changes --- docs/lang/articles/contribution/doc_writing.md | 2 +- docs/lang/articles/glossary/glossary.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/lang/articles/contribution/doc_writing.md b/docs/lang/articles/contribution/doc_writing.md index d15bc1d894..8602138950 100644 --- a/docs/lang/articles/contribution/doc_writing.md +++ b/docs/lang/articles/contribution/doc_writing.md @@ -62,7 +62,7 @@ def paint(t: float): ## Cross-references -To link to another section within the same article, you would use `[Return to ## 1. Code blocks](#1-code-blocks)`: [Return to ## 1. Code blocks](#code-blocks). +To link to another section within the same article, you would use `[Return to ## 1. Code blocks](#1-code-blocks)`: [Return to ## 1. Code blocks](#1-code-blocks). We follow the best practices suggested by [Docusaurus](https://docusaurus.io/docs/markdown-features/links) to cross-reference other documents, so to link to sections in other articles, please use the following relative-path based syntax, which is docs-versioning and IDE/GitHub friendly: diff --git a/docs/lang/articles/glossary/glossary.md b/docs/lang/articles/glossary/glossary.md index 76a9ecaf0b..c338140048 100644 --- a/docs/lang/articles/glossary/glossary.md +++ b/docs/lang/articles/glossary/glossary.md @@ -24,7 +24,7 @@ sidebar_position: 5 -See also [structure of arrays](#structure-of-arrays-soa). +See also [structure of arrays](./glossary.md/#structure-of-arrays-soa). ## Assert statement @@ -50,7 +50,7 @@ See also [structure of arrays](#structure-of-arrays-soa). -See also [row-major order](#row-major-order). +See also [row-major order](./glossary.md/#row-major-order). ## Compound type @@ -176,7 +176,7 @@ The Python scope corresponds to the host side in CUDA. -See also [coloum-major order](#column-major-order). +See also [coloum-major order](./glossary.md/#column-major-order). ## Shader storage buffer object (SSBO) @@ -200,7 +200,7 @@ A static scope is a scope of the argument of `ti.static`, which is a hint for th -See also [array of structures](#array-of-structures-aos). +See also [array of structures](./glossary.md/#array-of-structures-aos). ## Taichi function From f5b017c49c94662a07363c7667f318085c92fdd0 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Tue, 3 Jun 2025 10:20:08 -0700 Subject: [PATCH 11/11] revert files to main --- docs/lang/articles/reference/operator.md | 4 +++- docs/lang/articles/reference/simt.md | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/lang/articles/reference/operator.md b/docs/lang/articles/reference/operator.md index a6972ac2dd..16a9aa5e83 100644 --- a/docs/lang/articles/reference/operator.md +++ b/docs/lang/articles/reference/operator.md @@ -56,7 +56,9 @@ Python3 distinguishes `/` (true division) and `//` (floor division), e.g., `1.0 operands to the default integral type. To avoid such implicit casting, you can manually cast your operands to -desired types, using `ti.cast`. +desired types, using `ti.cast`. Please see +[Default precisions](#default-precisions) for more details on +default numerical types. Taichi also provides `ti.raw_div` function which performs true division if one of the operands is floating point type and performs floor division if both operands are integral types. diff --git a/docs/lang/articles/reference/simt.md b/docs/lang/articles/reference/simt.md index b66e729e0e..e4fd41986a 100644 --- a/docs/lang/articles/reference/simt.md +++ b/docs/lang/articles/reference/simt.md @@ -27,6 +27,9 @@ similar to the [usage in CUDA kernels](https://developer.nvidia.com/blog/using-c |`ti.simt.warp.active_mask` | `__activemask` | |`ti.simt.warp.sync` | `__syncwarp` | +See [Taichi's API reference](https://docs.taichi-lang.org/api/taichi/lang/simt/warp/#module-taichi.lang.simt.warp) +for more information on each function. + Here is an example of performing data exchange within a warp in Taichi: