Skip to content

Commit fc8fd1d

Browse files
committed
merge
2 parents 36058f2 + 42d3012 commit fc8fd1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+895
-200
lines changed

.github/AI_GUIDELINES.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
> This guideline is adapted from the LLVM AI Tool Use Policy found here: https://llvm.org/docs/AIToolPolicy.html, and may be updated as need be.
2+
3+
# Guideline
4+
5+
NSF Unidata's guideline is that **contributors can use whatever tools they would like to craft their contributions, but there must be a human in the loop.** Contributors *must* read and review all LLM-generated code or text before they ask other project members to review it. The contributor is always the author and is fully accountable for their contributions. Contributors should be sufficiently confident that the contribution is high enough quality that asking for a review is a good use of scarce maintainer time, and they should be able to answer questions about their work during review.
6+
7+
We expect that new contributors will be less confident in their contributions, and our guidance to them is to start with small contributions that they can fully understand to build confidence. We aspire to be a welcoming community that helps new contributors grow their expertise, but learning involves taking small steps, getting feedback, and iterating. Passing maintainer feedback to an LLM doesn’t help anyone grow, and does not sustain our community.
8+
9+
Contributors are expected to be transparent and label contributions that contain substantial amounts of tool-generated content. Our guideline on labelling is intended to facilitate reviews. **Contributors should note tool usage in their pull request description, commit message, or wherever authorship is normally indicated for the work.**
10+
11+
> For instance, use a commit message trailer like Assisted-by: . This transparency helps the community develop best practices and understand the role of these new tools.
12+
13+
This guideline includes, but is not limited to, the following kinds of contributions:
14+
15+
* Code, usually in the form of a pull request
16+
* Issues or security vulnerabilities
17+
* Comments and feedback on pull requests
18+
19+
# Details
20+
21+
To ensure sufficient self review and understanding of the work, it is strongly recommended that contributors write PR descriptions themselves (if needed, using tools for translation or copy-editing). The description should explain the motivation, implementation approach, expected impact, and any open questions or uncertainties to the same extent as a contribution made without tool assistance.
22+
23+
An important implication of this guideline is that it bans agents that take action in our digital spaces without human approval, such as the GitHub @claude agent. Similarly, automated review tools that publish comments without human review are not allowed. However, an opt-in review tool that keeps a human in the loop is acceptable under this guideline.
24+
25+
> As another example, using an LLM to generate documentation, which a contributor manually reviews for correctness, edits, and then posts as a PR, is an approved use of tools under this guideline.
26+
27+
# Extractive Contributions
28+
29+
> Prior to the advent of LLMs, open source project maintainers would often review any and all changes sent to the project simply because posting a change for review was a sign of interest from a potential long-term contributor. While new tools enable more development, it shifts effort from the implementor to the reviewer, and our guidelines exist to ensure that we value and do not squander maintainer or contributor time.
30+
31+
The reason for our “human-in-the-loop” contribution guideline is that processing patches, PRs, RFCs, and comments to NSF Unidata's projects is not free – it takes a lot of maintainer time and energy to review those contributions! Sending the *unreviewed* output of an LLM to open source project maintainers extracts work from them in the form of design and code review, so we call this kind of contribution an “extractive contribution”.
32+
33+
Our golden rule is that a contribution should be worth more to the project than the time it takes to review it. These ideas are captured by this quote from the book Working in Public by Nadia Eghbal:
34+
35+
> “When attention is being appropriated, producers need to weigh the costs and benefits of the transaction. To assess whether the appropriation of attention is net-positive, it’s useful to distinguish between extractive and non-extractive contributions. Extractive contributions are those where the marginal cost of reviewing and merging that contribution is greater than the marginal benefit to the project’s producers. In the case of a code contribution, it might be a pull request that’s too complex or unwieldy to review, given the potential upside.” – Nadia Eghbal
36+
37+
Reviewing changes from new contributors is part of growing the next generation of contributors and sustaining the project. We want the suite of NSF Unidata projects to be welcoming and open to aspiring developers who are willing to invest time and effort to learn and grow, because growing our contributor base and recruiting new maintainers helps sustain the project over the long term. Being open to contributions and liberally granting commit access is a big part of how projects at NSF Unidata have grown and successfully been adopted all across the community. We therefore automatically encourage maintainers to spend their time to help new contributors learn.
38+
39+
# Handling Violations
40+
41+
If a maintainer judges that a contribution doesn’t comply with this guideline, they should paste the following response to request changes:
42+
43+
> This PR doesn't appear to comply with our guideline on tool-generated content,
44+
and requires additional justification for why it is valuable enough to the
45+
project for us to review it. Please see our developer guideline on
46+
AI-generated contributions: https://github.com/Unidata/netcdf-c/blob/main/.github/AI_GUIDELINES.md
47+
48+
The best ways to make a change less extractive and more valuable are to reduce its size or complexity or to increase its usefulness to the community. These factors are impossible to weigh objectively, and our project guideline leaves this determination up to the maintainers of the project, i.e. those who are doing the work of sustaining the project.
49+
50+
Maintainers reserve the right to close or defer the review of extractive PRs.
51+
52+
# Copyright
53+
54+
Artificial intelligence systems raise many questions around copyright that have yet to be answered. Our guideline on AI tools is similar to our copyright policy: Contributors are responsible for ensuring that they have the right to contribute code under the terms of our license, typically meaning that either they, their employer, or their collaborators hold the copyright. Using AI tools to regenerate copyrighted material does not remove the copyright, and contributors are responsible for ensuring that such material does not appear in their contributions. Contributions found to violate this guideline will be removed just like any other offending contribution.
55+
56+
# References
57+
58+
Our guideline was informed by and adapted from
59+
60+
* [LLVM AI Tool Use Policy](https://llvm.org/docs/AIToolPolicy.html)
61+
* [Slop is the new name for unwanted AI-generated content](https://simonwillison.net/2024/May/8/slop/)

.github/CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Thanks for your interest in contributing to the netCDF project. There are many
66
77
## Table of Contents
88

9+
* [AI and LLM Guidelines](#aiguidelines)
910
* [Workflow](#workflow)
1011
* [Characteristics of an accepted pull request](#chars)
1112
* [Small bug-and-typo fixes](#smallissues)
@@ -15,6 +16,10 @@ Thanks for your interest in contributing to the netCDF project. There are many
1516
* [Regression testing with Docker](#regression)
1617
* [Final Remarks](#conclusion)
1718

19+
# AI and LLM Policy <A NAME="aiguidelines"></A>
20+
21+
Please see AI tool use guidelines found here: [NSF Unidata AI Tool Guidelines](https://github.com/Unidata/netcdf-c/blob/main/.github/AI_GUIDELINES.md).
22+
1823
# Workflow <A NAME="workflow"></A>
1924

2025
The process for contributing a patch to netCDF roughly follows the following workflow:
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
###
2+
# Build and test netCDF-C on a big-endian platform using QEMU emulation.
3+
#
4+
# Target: IBM s390x (z/Architecture), which is big-endian.
5+
# The job runs on a standard x86-64 GitHub Actions runner but uses
6+
# uraimo/run-on-arch-action to spin up a QEMU-emulated s390x container.
7+
# This lets us verify that netCDF-C builds and tests correctly on a
8+
# big-endian architecture without needing dedicated hardware.
9+
#
10+
# HDF5 is installed from the Ubuntu apt repository (libhdf5-dev) rather
11+
# than built from source, because building HDF5 from source inside QEMU
12+
# requires running compiled test binaries which fails under emulation.
13+
#
14+
# Triggered manually (workflow_dispatch) or on pull requests to main.
15+
###
16+
17+
name: Run NON-REMOTE Big-Endian (s390x) netCDF Tests
18+
19+
on:
20+
workflow_dispatch:
21+
pull_request:
22+
branches:
23+
- main
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.head_ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
31+
nc-bigendian-s390x:
32+
33+
name: Autotools build on s390x (big-endian)
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
38+
- uses: actions/checkout@v4
39+
40+
- name: Add swap space
41+
# QEMU emulation is memory-intensive. The default GitHub Actions runner
42+
# has limited swap, which can cause GCC's collect2 linker to segfault.
43+
# Adding 16GB of swap reduces this risk. We also pass -Wl,--no-keep-memory
44+
# to the linker to reduce its peak memory usage.
45+
run: |
46+
sudo swapoff -a || true
47+
sudo dd if=/dev/zero of=/swapfile bs=1M count=16384
48+
sudo chmod 600 /swapfile
49+
sudo mkswap /swapfile
50+
sudo swapon /swapfile
51+
free -h
52+
53+
- name: Build and test on s390x via QEMU
54+
uses: uraimo/run-on-arch-action@v2
55+
with:
56+
arch: s390x
57+
distro: ubuntu22.04
58+
59+
# githubToken enables caching of the QEMU container image in the
60+
# GitHub Container Registry, speeding up subsequent runs.
61+
githubToken: ${{ github.token }}
62+
63+
install: |
64+
apt-get update -q -y
65+
# Print available HDF5 packages for debugging purposes
66+
apt-cache search libhdf5 | sort
67+
apt-get install -q -y \
68+
libaec-dev \
69+
zlib1g-dev \
70+
automake \
71+
autoconf \
72+
libcurl4-openssl-dev \
73+
libjpeg-dev \
74+
wget \
75+
curl \
76+
bzip2 \
77+
m4 \
78+
flex \
79+
bison \
80+
cmake \
81+
libzip-dev \
82+
libhdf5-dev \
83+
libhdf5-103-1 \
84+
libtool \
85+
gcc \
86+
g++ \
87+
clang \
88+
binutils-gold
89+
90+
run: |
91+
set -e
92+
set -x
93+
94+
###
95+
# Regenerate the autotools build system from source.
96+
# This is required because the checked-out tree may not include
97+
# generated files (configure, Makefile.in, etc.).
98+
###
99+
autoreconf -if
100+
101+
###
102+
# Configure netCDF-C against the apt-installed HDF5 serial library.
103+
#
104+
# The HDF5 serial library on Ubuntu s390x lives in a non-standard
105+
# path (/usr/lib/s390x-linux-gnu/hdf5/serial), so we pass explicit
106+
# CPPFLAGS, LDFLAGS, and LIBS to point configure there.
107+
#
108+
# Features disabled to avoid missing dependencies under emulation:
109+
# --disable-dap : requires curl/libxml2 remote access
110+
# --disable-dap-remote-tests: requires a live DAP server
111+
# --disable-nczarr : requires additional zip/cloud libs
112+
# --disable-libxml2 : not needed without DAP
113+
# --disable-shared : simplifies linking under emulation
114+
# --enable-utilities : builds ncgen/ncdump/etc. binaries
115+
###
116+
CPPFLAGS="-I/usr/include/hdf5/serial" \
117+
LDFLAGS="-L/usr/lib/s390x-linux-gnu/hdf5/serial -fuse-ld=gold -Wl,--no-keep-memory" \
118+
LIBS="-lhdf5_serial -lz" \
119+
CFLAGS="-O0 -g" \
120+
CC=clang \
121+
./configure \
122+
--enable-hdf5 \
123+
--disable-dap \
124+
--disable-dap-remote-tests \
125+
--disable-nczarr \
126+
--disable-libxml2 \
127+
--disable-shared \
128+
--enable-static \
129+
--enable-utilities \
130+
|| { tail -200 config.log; exit 1; }
131+
132+
cat libnetcdf.settings
133+
134+
make -j 4
135+
136+
###
137+
# Build and run the test suite.
138+
# make check TESTS="" builds the test binaries without running them,
139+
# then make check runs the full suite.
140+
###
141+
make check TESTS="" -j 4
142+
make check -j 4
143+
144+
- name: Show test logs on failure
145+
if: ${{ failure() }}
146+
run: |
147+
find /home/runner/work/netcdf-c/netcdf-c -name 'test-suite.log' | \
148+
xargs -I{} sh -c 'echo "=== {} ==="; cat "{}"' || true
149+
cat config.log || true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ build_llvm
6464
.vagrant
6565
Vagrantfile
6666
netcdf-fortran
67+
.windsurf

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ project(netCDF
1313
LANGUAGES C CXX
1414
HOMEPAGE_URL "https://www.unidata.ucar.edu/software/netcdf/"
1515
DESCRIPTION "NetCDF is a set of software libraries and machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data."
16-
VERSION 4.10.0
16+
VERSION 4.10.1
1717
)
1818

1919
#####

0 commit comments

Comments
 (0)