Skip to content

Commit 81a83c9

Browse files
authored
Merge pull request #1941 from veg/develop
2.5.91
2 parents a362e3d + 208cd6d commit 81a83c9

File tree

5 files changed

+47
-117
lines changed

5 files changed

+47
-117
lines changed

.github/workflows/wasm-build.yml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
# Allows running this workflow manually from the Actions tab
88
workflow_dispatch:
99

10+
permissions:
11+
contents: write
12+
1013
jobs:
1114
build-wasm:
1215
name: Build WebAssembly
@@ -25,31 +28,15 @@ jobs:
2528
2629
- name: Configure and build with Emscripten
2730
run: |
28-
# Build with Emscripten - but without preloading files to avoid issues with CMake tests
2931
mkdir -p build
3032
cd build
3133
32-
# Configure without preload files to avoid issues during compiler checks
33-
emcmake cmake .. -DCMAKE_EXE_LINKER_FLAGS="-sTOTAL_STACK=2097152 -O2 -sASSERTIONS=1 -sMODULARIZE=1 -sALLOW_MEMORY_GROWTH -sFORCE_FILESYSTEM=1 -sEXIT_RUNTIME=0 -s EXPORTED_RUNTIME_METHODS=[\"callMain\",\"FS\",\"PROXYFS\",\"WORKERFS\",\"UTF8ToString\",\"getValue\",\"AsciiToString\"] -lworkerfs.js -lproxyfs.js -s INVOKE_RUN=0 -s ENVIRONMENT=\"web,worker\" -fwasm-exceptions"
34+
# Configure with preload files to generate hyphy.data
35+
# Map local ../res to /res in the virtual filesystem
36+
emcmake cmake .. -DCMAKE_EXE_LINKER_FLAGS="-sTOTAL_STACK=2097152 -O2 -sASSERTIONS=1 -sMODULARIZE=1 -sALLOW_MEMORY_GROWTH -sFORCE_FILESYSTEM=1 -sEXIT_RUNTIME=0 -s EXPORTED_RUNTIME_METHODS=[\"callMain\",\"FS\",\"PROXYFS\",\"WORKERFS\",\"UTF8ToString\",\"getValue\",\"AsciiToString\"] -lworkerfs.js -lproxyfs.js -s INVOKE_RUN=0 -s ENVIRONMENT=\"web,worker\" -fwasm-exceptions --preload-file ../res@/res"
3437
35-
# Build without preloading files
3638
emmake make -j hyphy
3739
38-
- name: Package resource files
39-
run: |
40-
cd build
41-
42-
# Instead of bundling resources, we'll package them separately for download
43-
mkdir -p hyphy_resources
44-
cp -r ../res hyphy_resources/
45-
cp -r ../tests/hbltests hyphy_resources/tests
46-
47-
# Create a README for the resources
48-
echo "These resource files should be placed in the same directory as hyphy.js, hyphy.wasm, and hyphy.data" > hyphy_resources/README.txt
49-
50-
# Create a zip file of the resources
51-
tar -czvf hyphy_resources.tar.gz hyphy_resources
52-
5340
- name: Display build artifacts
5441
run: |
5542
cd build
@@ -63,5 +50,20 @@ jobs:
6350
build/hyphy.js
6451
build/hyphy.wasm
6552
build/hyphy.data
66-
build/hyphy_resources.tar.gz
67-
retention-days: 30
53+
retention-days: 30
54+
55+
- name: Prepare for deployment
56+
run: |
57+
mkdir -p public
58+
cp build/hyphy.js public/
59+
cp build/hyphy.wasm public/
60+
cp build/hyphy.data public/
61+
echo "<html><body><h1>HyPhy WASM Build</h1><ul><li><a href='hyphy.wasm'>hyphy.wasm</a></li><li><a href='hyphy.js'>hyphy.js</a></li><li><a href='hyphy.data'>hyphy.data</a></li></ul></body></html>" > public/index.html
62+
63+
- name: Deploy to GitHub Pages
64+
uses: peaceiris/actions-gh-pages@v3
65+
if: github.ref == 'refs/heads/master'
66+
with:
67+
github_token: ${{ secrets.GITHUB_TOKEN }}
68+
publish_dir: ./public
69+
publish_branch: gh-pages

res/TemplateBatchFiles/SelectionAnalyses/BUSTED-PH.bf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ if (!busted.run_background_test) {
119119
"{terms.json.omega_ratio : busted.inferred_test_distribution_raw [_index_][0],
120120
terms.json.proportion : busted.inferred_test_distribution_raw [_index_][1]}")};
121121

122-
busted.report_multi_hit (busted.null_results, busted.distribution_for_json, "MultiHit", "null-mh",busted.branch_length_string, busted.model_parameters);
122+
busted.report_multi_hit (busted.background_null_results, busted.distribution_for_json, "MultiHit", "null-mh",busted.branch_length_string, busted.model_parameters);
123123
busted.null_distro_raw = parameters.GetStickBreakingDistribution (busted.distribution);
124124

125125
if (busted.error_sink) {

res/TemplateBatchFiles/SelectionAnalyses/contrast-fel.bf

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ io.ReportProgressMessageMD('FEL', 'selector', 'Branches to use as the test set
148148

149149
fel.branch_sets = {};
150150

151-
utility.ForEachPair (fel.selected_branches[0], "_branch_", "_model_",
152-
"
151+
for (_branch_, _model_; in; fel.selected_branches[0]) {
153152
utility.EnsureKey (fel.branch_sets, _model_);
154153
fel.branch_sets[_model_] + _branch_;
155-
");
154+
}
155+
156156

157157
fel.branch_class_count = utility.Array1D (fel.branch_sets);
158158
fel.scaler_parameter_names = {};
@@ -164,23 +164,22 @@ fel.branches.testable = {};
164164
fel.branches.has_background = FALSE;
165165

166166

167-
utility.ForEachPair (fel.branch_sets, "_group_", "_branches_",
168-
"
169-
if (_group_ != terms.tree_attributes.background) {
170-
fel.site_tested_classes [_group_] = 'Site relative non-synonymous rate (' + _group_ + ' branches)';
171-
fel.branch_class_counter += 1;
172-
fel.branches.testable + _group_;
173-
fel.scaler_parameter_names [_group_] = 'fel.beta_scaler_group_' + fel.branch_class_counter;
174-
io.ReportProgressMessageMD('FEL', 'selector', '* Selected ' + Abs(_branches_) + ' branches in group _' + _group_ + '_ : \\\`' + Join (', ',_branches_) + '\\\`')
175-
} else {
176-
fel.scaler_parameter_names [_group_] = 'fel.beta_scaler_background';
177-
fel.site_tested_classes [_group_] = 'Site relative non-synonymous rate (reference branches)';
178-
fel.branches.has_background = TRUE;
179-
io.ReportProgressMessageMD('FEL', 'selector', '* ' + Abs(_branches_) + ' branches are in the background group : \\\`' + Join (', ',_branches_) + '\\\`')
180-
}
181-
"
182-
);
167+
for (_group_, _branches_; in; fel.branch_sets) {
168+
if (_group_ != terms.tree_attributes.background) {
169+
fel.site_tested_classes [_group_] = 'Site relative non-synonymous rate (' + _group_ + ' branches)';
170+
fel.branch_class_counter += 1;
171+
fel.branches.testable + _group_;
172+
fel.scaler_parameter_names [_group_] = 'fel.beta_scaler_group_' + fel.branch_class_counter;
173+
io.ReportProgressMessageMD('FEL', 'selector', '* Selected ' + Abs(_branches_) + ' branches in group _' + _group_ + '_ : \\\`' + Join (', ',_branches_) + '\\\`')
174+
} else {
175+
fel.scaler_parameter_names [_group_] = 'fel.beta_scaler_background';
176+
fel.site_tested_classes [_group_] = 'Site relative non-synonymous rate (reference branches)';
177+
fel.branches.has_background = TRUE;
178+
io.ReportProgressMessageMD('FEL', 'selector', '* ' + Abs(_branches_) + ' branches are in the background group : \\\`' + Join (', ',_branches_) + '\\\`')
179+
}
180+
}
183181

182+
io.CheckAssertion ("utility.Array1D(fel.branches.testable) > 0", "Must select a non-empty testable branch set");
184183

185184

186185
fel.test_count = 1;
@@ -614,6 +613,7 @@ lfunction fel.select_branches(partition_info) {
614613
selectTheseForTesting[k][1] = "Set of " + available_models[list_models[k-3]] + " unlabeled branches";
615614
}
616615
}
616+
617617

618618
ChoiceList(testSet, "Choose sets of branches to compare. If more than one set is chosen, pairwise comparisons will be carried out in addition to a group-level difference test.", 0, NO_SKIP, selectTheseForTesting);
619619
io.CheckAssertion ("`&testSet[0]` >= 0", "User cancelled branch selection; analysis terminating");
@@ -623,6 +623,7 @@ lfunction fel.select_branches(partition_info) {
623623
tree_for_analysis = (partition_info[0])[utility.getGlobalValue("terms.data.tree")];
624624
branch_set_count = utility.Array1D (testSet);
625625
test_sets = {};
626+
626627

627628
for (k = 0; k < branch_set_count; k+=1) {
628629
tag_test = selectTheseForTesting [testSet[k]][0];
@@ -632,6 +633,7 @@ lfunction fel.select_branches(partition_info) {
632633
test_sets[tag_test] = TRUE;
633634
}
634635

636+
635637
if (test_sets / 'Random set of branches') {
636638
KeywordArgument ("random-subset", "How many branches in the random subset to test", (internal_count+leaf_count)$2);
637639
test_count = io.PromptUser ("How many branches in the test set", (internal_count+leaf_count)$2,1,(internal_count+leaf_count), TRUE);

src/core/global_things.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ _String const kEmptyString, kPromptForFilePlaceholder("PROMPT_FOR_FILE"),
115115
"\"ENV=TOLERATE_NUMERICAL_ERRORS=1;\" as the command line "
116116
"argument. This often resolves the issue, which is "
117117
"indicative of numerical instability."),
118-
kHyPhyVersion = _String("2.5.90"),
118+
kHyPhyVersion = _String("2.5.91"),
119119

120120
kNoneToken = "None", kNullToken = "null",
121121
kNoKWMatch = "__input_value_not_given__",

src/core/matrix_kernels.cpp

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -39,81 +39,7 @@
3939

4040
#include "matrix_kernels.h"
4141

42-
/**** START: ARM SVE CODE *****/
43-
44-
#ifdef _SLKP_USE_ARM_SVE
45-
#include <arm_sve.h>
46-
47-
void _matrix_kernel_multiply_by_compressed_sparse(hyFloat *resBase,
48-
const long *compIdx,
49-
const hyFloat *secondArgBase,
50-
const hyFloat *theDataPtr,
51-
long N) {
52-
long currentXIndex = 0L;
53-
hyFloat *res = resBase;
54-
55-
uint64_t vl = svcntd();
56-
57-
for (long i = 0; i < N; i++) {
58-
long up = compIdx[i];
59-
60-
if (currentXIndex < up) {
61-
long j = 0;
62-
// Unrolled loop
63-
while (j + 4 * vl <= N) {
64-
svbool_t pgAll = svptrue_b64();
65-
svfloat64_t acc0 = svld1(pgAll, res + j);
66-
svfloat64_t acc1 = svld1(pgAll, res + j + vl);
67-
svfloat64_t acc2 = svld1(pgAll, res + j + 2 * vl);
68-
svfloat64_t acc3 = svld1(pgAll, res + j + 3 * vl);
69-
70-
for (long cxi = currentXIndex; cxi < up; cxi++) {
71-
long currentXColumn = compIdx[cxi + N];
72-
const hyFloat *secArg = secondArgBase + currentXColumn * N;
73-
svfloat64_t valVec = svdup_f64(theDataPtr[cxi]);
74-
75-
svfloat64_t b0 = svld1(pgAll, secArg + j);
76-
svfloat64_t b1 = svld1(pgAll, secArg + j + vl);
77-
svfloat64_t b2 = svld1(pgAll, secArg + j + 2 * vl);
78-
svfloat64_t b3 = svld1(pgAll, secArg + j + 3 * vl);
79-
80-
acc0 = svmla_f64_x(pgAll, acc0, valVec, b0);
81-
acc1 = svmla_f64_x(pgAll, acc1, valVec, b1);
82-
acc2 = svmla_f64_x(pgAll, acc2, valVec, b2);
83-
acc3 = svmla_f64_x(pgAll, acc3, valVec, b3);
84-
}
85-
86-
svst1(pgAll, res + j, acc0);
87-
svst1(pgAll, res + j + vl, acc1);
88-
svst1(pgAll, res + j + 2 * vl, acc2);
89-
svst1(pgAll, res + j + 3 * vl, acc3);
90-
91-
j += 4 * vl;
92-
}
93-
94-
// Tail loop
95-
while (j < N) {
96-
svbool_t pg = svwhilelt_b64(j, N);
97-
svfloat64_t acc = svld1(pg, res + j);
98-
99-
for (long cxi = currentXIndex; cxi < up; cxi++) {
100-
long currentXColumn = compIdx[cxi + N];
101-
const hyFloat *secArg = secondArgBase + currentXColumn * N;
102-
svfloat64_t valVec = svdup_f64(theDataPtr[cxi]);
103-
svfloat64_t b = svld1(pg, secArg + j);
104-
acc = svmla_f64_m(pg, acc, valVec, b);
105-
}
106-
svst1(pg, res + j, acc);
107-
j += vl;
108-
}
109-
}
110-
111-
res += N;
112-
currentXIndex = up;
113-
}
114-
}
115-
116-
#elif defined _SLKP_USE_ARM_NEON
42+
#if defined _SLKP_USE_ARM_NEON
11743

11844
void _matrix_kernel_multiply_by_compressed_sparse(hyFloat *resBase,
11945
const long *compIdx,

0 commit comments

Comments
 (0)