From 869d852bd7bf0531af4605773615c0bf0c911d48 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 17 May 2024 19:45:11 +0200 Subject: Prepare for next step --- TODO.txt | 2 +- src/cube_avx2.h | 8 ++++++++ src/cube_portable.h | 8 ++++++++ src/solve_h48.h | 13 +++---------- test/078_invcoord_esep/00_solved.in | 1 + test/078_invcoord_esep/00_solved.out | 1 + test/078_invcoord_esep/01_U.in | 1 + test/078_invcoord_esep/01_U.out | 1 + test/078_invcoord_esep/02_U2.in | 1 + test/078_invcoord_esep/02_U2.out | 1 + test/078_invcoord_esep/20_scrambled.in | 3 +++ test/078_invcoord_esep/20_scrambled.out | 1 + test/078_invcoord_esep/21_swapaxis_FB.in | 1 + test/078_invcoord_esep/21_swapaxis_FB.out | 1 + test/078_invcoord_esep/22_swapaxis_RL.in | 1 + test/078_invcoord_esep/22_swapaxis_RL.out | 1 + test/078_invcoord_esep/23_swapaxis_UD.in | 1 + test/078_invcoord_esep/23_swapaxis_UD.out | 1 + test/078_invcoord_esep/invcoord_esep_tests.c | 24 ++++++++++++++++++++++++ 19 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 test/078_invcoord_esep/00_solved.in create mode 100644 test/078_invcoord_esep/00_solved.out create mode 100644 test/078_invcoord_esep/01_U.in create mode 100644 test/078_invcoord_esep/01_U.out create mode 100644 test/078_invcoord_esep/02_U2.in create mode 100644 test/078_invcoord_esep/02_U2.out create mode 100644 test/078_invcoord_esep/20_scrambled.in create mode 100644 test/078_invcoord_esep/20_scrambled.out create mode 100644 test/078_invcoord_esep/21_swapaxis_FB.in create mode 100644 test/078_invcoord_esep/21_swapaxis_FB.out create mode 100644 test/078_invcoord_esep/22_swapaxis_RL.in create mode 100644 test/078_invcoord_esep/22_swapaxis_RL.out create mode 100644 test/078_invcoord_esep/23_swapaxis_UD.in create mode 100644 test/078_invcoord_esep/23_swapaxis_UD.out create mode 100644 test/078_invcoord_esep/invcoord_esep_tests.c diff --git a/TODO.txt b/TODO.txt index 5441a9f..affddec 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,8 +1,8 @@ In progress: go back to nissy-style BFS for eosep data computation - (done) compute selfsim and cocsep representatives - (done) implement set_eo_fast for invcoord_h48 + - for invcoord_h48 remove erep, implement inverse esep coord - add unit tests for invcoord_h48 (compute tables, if needed) - - in gendata_esep, compute representatives for esep inverse coordinate - change to BFS TODO pruning tables: diff --git a/src/cube_avx2.h b/src/cube_avx2.h index 8d1c940..30b0c0f 100644 --- a/src/cube_avx2.h +++ b/src/cube_avx2.h @@ -28,6 +28,7 @@ _static_inline int64_t coord_fast_esep(cube_fast_t); _static_inline void copy_corners_fast(cube_fast_t *, cube_fast_t); _static_inline void copy_edges_fast(cube_fast_t *, cube_fast_t); _static_inline void set_eo_fast(cube_fast_t *, int64_t); +_static_inline cube_fast_t invcoord_fast_esep(int64_t); _static_inline cube_fast_t fastcube( @@ -268,3 +269,10 @@ set_eo_fast(cube_fast_t *cube, int64_t eo) *cube = _mm256_andnot_si256(_eo_avx2, *cube); *cube = _mm256_or_si256(*cube, veo); } + +_static_inline cube_fast_t +invcoord_fast_esep(int64_t esep) +{ + /* TODO */ + return cubetofast(zero); +} diff --git a/src/cube_portable.h b/src/cube_portable.h index 125c300..24c39e8 100644 --- a/src/cube_portable.h +++ b/src/cube_portable.h @@ -22,6 +22,7 @@ _static_inline int64_t coord_fast_esep(cube_fast_t); _static_inline void copy_corners_fast(cube_fast_t *, cube_fast_t); _static_inline void copy_edges_fast(cube_fast_t *, cube_fast_t); _static_inline void set_eo_fast(cube_fast_t *, int64_t); +_static_inline cube_fast_t invcoord_fast_esep(int64_t); _static_inline cube_fast_t fastcube( @@ -251,3 +252,10 @@ set_eo_fast(cube_fast_t *cube, int64_t eo) } cube->edge[0] = (cube->edge[0] & ~_eobit) | (_eobit * (sum%2)); } + +_static_inline cube_fast_t +invcoord_fast_esep(int64_t esep) +{ + /* TODO */ + return cubetofast(zero); +} diff --git a/src/solve_h48.h b/src/solve_h48.h index 2fe1d69..d4a018b 100644 --- a/src/solve_h48.h +++ b/src/solve_h48.h @@ -39,8 +39,7 @@ typedef struct { } dfsarg_esep_t; _static_inline int64_t coord_h48(cube_fast_t, const uint32_t *, uint8_t); -_static_inline cube_fast_t invcoord_h48(int64_t, const uint32_t *, - const cube_fast_t *, const cube_fast_t *, uint8_t); +_static_inline cube_fast_t invcoord_h48(int64_t, const cube_fast_t *, uint8_t); _static size_t gendata_cocsep(void *, uint64_t *, cube_fast_t *); _static uint32_t gendata_cocsep_dfs(dfsarg_cocsep_t *); @@ -77,13 +76,7 @@ coord_h48(cube_fast_t c, const uint32_t *cocsepdata, uint8_t h) } _static_inline cube_fast_t -invcoord_h48( - int64_t i, - const uint32_t *cocsepdata, - const cube_fast_t *crep, - const cube_fast_t *erep, - uint8_t h -) +invcoord_h48(int64_t i, const cube_fast_t *crep, uint8_t h) { cube_fast_t ret; int64_t coclass, ee, esep, eo; @@ -96,8 +89,8 @@ invcoord_h48( esep = ee >> h; eo = (ee & ((1<