Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
87cd37e
Added my updated workflow.
Anirban166 Mar 14, 2024
8716caa
Changed to a workflow that uses my action from the marketplace
Anirban166 Mar 14, 2024
3b17614
Added the current set of tests
Anirban166 Apr 12, 2024
ca2ec3c
Revert the change on the failing commit for the second test case
Anirban166 Apr 12, 2024
30eb136
Update tests.R
Anirban166 Apr 12, 2024
1a797ec
Trigger test (path filter)
Anirban166 Apr 12, 2024
39f0676
Test current state of tests
Anirban166 Apr 13, 2024
2491823
Test suggested changes
Anirban166 Apr 13, 2024
55bc2db
Testing another case
Anirban166 Apr 17, 2024
eae7f12
Change a variable name to be more generic
Anirban166 Apr 17, 2024
1fb384c
Update the other two test case comments to the current state of data.…
Anirban166 Apr 17, 2024
0c299ff
Trying an old commit for 'Regression'
Anirban166 Apr 17, 2024
b1ecd99
Switched directory (to accommodate the specific case for data.table)
Anirban166 Apr 17, 2024
cb8306a
Delete inst/atime/tests.R
Anirban166 Apr 17, 2024
853a74c
Trigger updated workflow (v1.2.0)
Anirban166 Apr 18, 2024
69845fd
Test a Slow/Fast case
Anirban166 Apr 18, 2024
ebcf5dd
Quote setup and expr for the fourth test case and comment out the thi…
Anirban166 Apr 18, 2024
870676a
Changed to more appropriate label names
Anirban166 Apr 18, 2024
5467fd3
Removed unnecessary double quotes
Anirban166 Apr 18, 2024
0cd4ac8
Test new atime code
Anirban166 Apr 23, 2024
7971d86
Move setattr() and setDT inside expr
Anirban166 Apr 23, 2024
f9b11de
Update tests.R
Anirban166 Apr 23, 2024
d0e2a97
Update tests.R
Anirban166 Apr 23, 2024
bc8243f
Close test.list
Anirban166 Apr 23, 2024
50515bb
Bring back the setDT call inside setup due to the irregular memory curve
Anirban166 Apr 23, 2024
5a1234a
Made the changes Toby introduced (switching to atime_test primarily)
Anirban166 Apr 29, 2024
fc6ff33
Checking if this works (to test the other changes)
Anirban166 Apr 29, 2024
6817a94
Update tests.R
Anirban166 Apr 29, 2024
e02c935
Update tests.R
Anirban166 Apr 29, 2024
e2171ce
Update tests.R
Anirban166 Apr 29, 2024
27ade59
Update tests.R
Anirban166 Apr 29, 2024
2738ce5
Update tests.R
Anirban166 Apr 29, 2024
c57ca22
Update tests.R
Anirban166 Apr 29, 2024
be51db1
Makes sense why the previous runs failed (setdt-wide here exists but …
Anirban166 Apr 29, 2024
95433cb
Update tests.R
Anirban166 May 28, 2024
4b386b7
Update tests.R
Anirban166 Jul 16, 2024
e0e70b8
Merge branch 'master' into test-action
Anirban166 Jul 16, 2024
051f940
Update tests.R
Anirban166 Jul 17, 2024
fb990b0
Update tests.R
Anirban166 Jul 17, 2024
c8c1083
Update tests.R
Anirban166 Jul 17, 2024
168389e
Synced master branch for git revparse to be able to find the commits.
Anirban166 Jul 17, 2024
e931f86
Update tests.R
Anirban166 Jul 17, 2024
d80b6d7
Update tests.R
Anirban166 Jul 18, 2024
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
105 changes: 45 additions & 60 deletions .ci/atime/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,66 +17,41 @@
# @note Please check https://github.com/tdhock/atime/blob/main/vignettes/data.table.Rmd for more information.
# nolint start: undesirable_operator_linter. ':::' needed+appropriate here.
test.list <- atime::atime_test_list(
# A function to customize R package metadata and source files to facilitate version-specific installation and testing.
#
# This is specifically tailored for handling data.table which requires specific changes in non-standard files (such as the object file name in Makevars and version checking code in onLoad.R)
# to support testing across different versions (base and HEAD for PRs, commits associated with historical regressions, etc.) of the package.
# It appends a SHA1 hash to the package name (PKG.SHA), ensuring each version can be installed and tested separately.
#
# @param old.Package Current name of the package.
# @param new.Package New name of the package, including a SHA hash.
# @param sha SHA1 hash used for differentiating versions.
# @param new.pkg.path Path to the package files.
#
# @details
# The function modifies:
# - DESCRIPTION, updating the package name.
# - Makevars, customizing the shared object file name and adjusting the build settings.
# - R/onLoad.R, adapting custom version checking for package loading operations.
# - NAMESPACE, changing namespace settings for dynamic linking.
#
# @examples
# pkg.edit.fun("data.table", "data.table.some_SHA1_hash", "some_SHA1_hash", "/path/to/data.table")
#
# @return None (performs in-place file modifications)
# @note This setup is typically unnecessary for most packages but essential for data.table due to its unique configuration.
pkg.edit.fun = function(old.Package, new.Package, sha, new.pkg.path) {
pkg_find_replace <- function(glob, FIND, REPLACE) {
atime::glob_find_replace(file.path(new.pkg.path, glob), FIND, REPLACE)
}
Package_regex <- gsub(".", "_?", old.Package, fixed = TRUE)
Package_ <- gsub(".", "_", old.Package, fixed = TRUE)
new.Package_ <- paste0(Package_, "_", sha)
pkg_find_replace(
"DESCRIPTION",
paste0("Package:\\s+", old.Package),
paste("Package:", new.Package))
pkg_find_replace(
file.path("src", "Makevars.*in"),
Package_regex,
new.Package_)
pkg_find_replace(
file.path("R", "onLoad.R"),
Package_regex,
new.Package_)
pkg_find_replace(
file.path("R", "onLoad.R"),
sprintf('packageVersion\\("%s"\\)', old.Package),
sprintf('packageVersion\\("%s"\\)', new.Package))
pkg_find_replace(
file.path("src", "init.c"),
paste0("R_init_", Package_regex),
paste0("R_init_", gsub("[.]", "_", new.Package_)))
pkg_find_replace(
"NAMESPACE",
sprintf('useDynLib\\("?%s"?', Package_regex),
paste0('useDynLib(', new.Package_))
},

# Performance regression discussed in: https://github.com/Rdatatable/data.table/issues/4311
# Fixed in: https://github.com/Rdatatable/data.table/pull/4440
pkg_find_replace <- function(glob, FIND, REPLACE) {
atime::glob_find_replace(file.path(new.pkg.path, glob), FIND, REPLACE)
}
Package_regex <- gsub(".", "_?", old.Package, fixed = TRUE)
Package_ <- gsub(".", "_", old.Package, fixed = TRUE)
new.Package_ <- paste0(Package_, "_", sha)
pkg_find_replace(
"DESCRIPTION",
paste0("Package:\\s+", old.Package),
paste("Package:", new.Package))
pkg_find_replace(
file.path("src", "Makevars.*in"),
Package_regex,
new.Package_)
pkg_find_replace(
file.path("R", "onLoad.R"),
Package_regex,
new.Package_)
pkg_find_replace(
file.path("R", "onLoad.R"),
sprintf('packageVersion\\("%s"\\)', old.Package),
sprintf('packageVersion\\("%s"\\)', new.Package))
pkg_find_replace(
file.path("src", "init.c"),
paste0("R_init_", Package_regex),
paste0("R_init_", gsub("[.]", "_", new.Package_)))
pkg_find_replace(
"NAMESPACE",
sprintf('useDynLib\\("?%s"?', Package_regex),
paste0('useDynLib(', new.Package_))
},

"shallow regression fixed in #4440" = atime::atime_test(
N = 10^seq(3,8),
N = 10^seq(3, 8),
setup = {
set.seed(1L)
dt <- data.table(a = sample.int(N))
Expand Down Expand Up @@ -119,6 +94,16 @@ test.list <- atime::atime_test_list(
data.table:::setDT(L)
},
Slow = "c4a2085e35689a108d67dacb2f8261e4964d7e12", # Parent of the first commit in the PR that fixes the issue (https://github.com/Rdatatable/data.table/commit/7cc4da4c1c8e568f655ab5167922dcdb75953801)
Fast = "1872f473b20fdcddc5c1b35d79fe9229cd9a1d15") # Last commit in the PR that fixes the issue (https://github.com/Rdatatable/data.table/pull/5427/commits)
Fast = "1872f473b20fdcddc5c1b35d79fe9229cd9a1d15"), # Last commit in the PR that fixes the issue (https://github.com/Rdatatable/data.table/pull/5427/commits) for my fork here.
# Merge commit in the PR that fixes the issue (https://github.com/Rdatatable/data.table/pull/5427) # <-- This too would probably work but in my fork I don't have any commits beyond 1872f473b20fdcddc5c1b35d79fe9229cd9a1d15 for that branch,

# Issue reported in: https://github.com/Rdatatable/data.table/issues/6286
"by with verbose = TRUE" = atime::atime_test(
N = 10^seq(1, 8),
setup = {
dt = data.table(a = 1:N)
},
expr = data.table:::copy(dt)[, 1, by = a, verbose = TRUE],
"Slow" = "a01f00f7438daf4612280d6886e6929fa8c8f76e",
"Fast" = "cd497408bb4dc6650d871b5076e738420ff431d7")
)
# nolint end: undesirable_operator_linter.
21 changes: 21 additions & 0 deletions .github/workflows/autocomment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Autocomment atime-based performance regression analysis on PRs

on:
pull_request:
branches:
- '*'
types:
- opened
- reopened
- synchronize

jobs:
comment:
runs-on: ubuntu-latest
container: ghcr.io/iterative/cml:0-dvc2-base1
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: Anirban166/Autocomment-atime-results@v1.1.0
1 change: 0 additions & 1 deletion src/negate.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ void negateByRef(SEXP x) {
}
}


SEXP notchin(SEXP x, SEXP table) {
// see discussion in PR#4931
SEXP result = PROTECT(chin(x, table));
Expand Down