SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.17470 · 2026

PhaSR: Generalized Image Shadow Removal with Physically Aligned Priors

Yu-Lun Liu, Chih-Chung Hsu, Chia-Ming Lee, Yu-Fan Lin, Jin-Hui Jiang, Yu-Jou Hsiao

arXiv · PDF · Open in the Atlas

Code that ran

11 of 17 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 2 failures of our instrument; 6 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2601.17470.json · badge: /api/ran/2601.17470.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ming053l/PhaSR community
Papers with Code archive
11 ran · 6 no recorded run
FunctionStatusWhere it lives
DifferentialLinearProjection Ran
ran on a synthesized input
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("67590adda48cbcf4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class DifferentialLinearProjection(nn.Module):
    """Modal-specific Differential Linear Projection"""

    def __init__(self, dim, heads=8, dim_head=64, dropout=0.0, bias=True):
        super().__init__()
        self.head_dim = dim_head
        inner_dim = dim_head * heads
        self.heads = heads
        self.to_q = nn.Linear(dim, inner_dim, bias=bias)
        self.to_kv_geometric = nn.Linear(dim, inner_dim * 2, bias=bias)
        self.to_kv_semantic = nn.Linear(dim, inner_dim * 2, bias=bias)
        self.geo_proj = nn.Linear(3, dim, bias=bias)
        self.dino_proj = nn.Linear(1024, dim, bias=bias)
        self.geo_weight = nn.Parameter(torch.tensor(0.1))
        self.sem_weight = nn.Parameter(torch.tensor(0.1))
        self.dim = dim
        self.inner_dim = inner_dim
        print('Modal-specific differential transformer initialized!')

    def forward(self, x, geo_feat, dino_feat, attn_kv=None):
        B_, N, C = x.shape
        attn_kv = x if attn_kv is None else attn_kv
        q = self.to_q(x).reshape(B_, N, 1, self.heads, self.head_dim).permute(2, 0, 3, 1, 4)
        q = q[0]
        geo_feat_proj = self.geo_proj(geo_feat)
        dino_feat_proj = self.dino_proj(dino_feat)
        geo_enhanced = attn_kv + self.geo_weight * geo_feat_proj
        semantic_enhanced = attn_kv + self.sem_weight * dino_feat_proj
        kv_geo = self.to_kv_geometric(geo_enhanced).reshape(B_, N, 2, self.heads, self.head_dim).permute(2, 0, 3, 1, 4)
        kv_sem = self.to_kv_semantic(semantic_enhanced).reshape(B_, N, 2, self.heads, self.head_dim).permute(2, 0, 3, 1, 4)
        k = torch.stack([kv_geo[0], kv_sem[0]], dim=0)
        v = torch.stack([kv_geo[1], kv_sem[1]], dim=0)
        return (q, k, v)


INIT_ARGS = {
    'dim': 4,
    'heads': 2,
    'dim_head': 8,
    'dropout': 0.0,
    'bias': True
}

ARGS = {
    'x': torch.randn(2, 5, 4),
    'geo_feat': torch.randn(2, 5, 3),
    'dino_feat': torch.randn(2, 5, 1024),
    'attn_kv': None
}

if __name__ == '__main__':
    model = DifferentialLinearProjection(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shapes: q={output[0].shape}, k={output[1].shape}, v={output[2].shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DifferentialLinearProjection_Concat_kv Ran
ran on a synthesized input
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("140f5ad1bb6a9d5b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class DifferentialLinearProjection_Concat_kv(nn.Module):
    """Concat version of Modal-specific Differential Linear Projection"""

    def __init__(self, dim, heads=8, dim_head=64, dropout=0.0, bias=True):
        super().__init__()
        self.head_dim = dim_head
        inner_dim = dim_head * heads
        self.heads = heads
        self.to_qkv = nn.Linear(dim, inner_dim * 3, bias=bias)
        self.to_kv_geometric = nn.Linear(dim, inner_dim * 2, bias=bias)
        self.to_kv_semantic = nn.Linear(dim, inner_dim * 2, bias=bias)
        self.geo_proj = nn.Linear(3, dim, bias=bias)
        self.dino_proj = nn.Linear(1024, dim, bias=bias)
        self.geo_weight = nn.Parameter(torch.tensor(0.1))
        self.sem_weight = nn.Parameter(torch.tensor(0.1))
        self.dim = dim
        self.inner_dim = inner_dim

    def forward(self, x, geo_feat, dino_feat, attn_kv=None):
        B_, N, C = x.shape
        attn_kv = x if attn_kv is None else attn_kv
        qkv_dec = self.to_qkv(x).reshape(B_, N, 3, self.heads, self.head_dim).permute(2, 0, 3, 1, 4)
        q, k_d, v_d = (qkv_dec[0], qkv_dec[1], qkv_dec[2])
        geo_feat_proj = self.geo_proj(geo_feat)
        dino_feat_proj = self.dino_proj(dino_feat)
        geo_enhanced = attn_kv + self.geo_weight * geo_feat_proj
        semantic_enhanced = attn_kv + self.sem_weight * dino_feat_proj
        kv_geo = self.to_kv_geometric(geo_enhanced).reshape(B_, N, 2, self.heads, self.head_dim).permute(2, 0, 3, 1, 4)
        kv_sem = self.to_kv_semantic(semantic_enhanced).reshape(B_, N, 2, self.heads, self.head_dim).permute(2, 0, 3, 1, 4)
        k_geo, v_geo = (kv_geo[0], kv_geo[1])
        k_sem, v_sem = (kv_sem[0], kv_sem[1])
        k = torch.cat((k_d, k_geo, k_sem), dim=2)
        v = torch.cat((v_d, v_geo, v_sem), dim=2)
        return (q, k, v)


INIT_ARGS = {
    'dim': 4,
    'heads': 2,
    'dim_head': 3,
    'dropout': 0.0,
    'bias': True
}

ARGS = {
    'x': torch.randn(2, 5, 4),
    'geo_feat': torch.randn(2, 5, 3),
    'dino_feat': torch.randn(2, 5, 1024),
    'attn_kv': None
}

model = DifferentialLinearProjection_Concat_kv(**INIT_ARGS)
q, k, v = model(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Downsample Ran
ran on a synthesized input
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("7394455830519eb7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 4096, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class Downsample(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(Downsample, self).__init__()
        self.conv = nn.Sequential(nn.Conv2d(in_channel, out_channel, kernel_size=4, stride=2, padding=1))
        self.in_channel = in_channel
        self.out_channel = out_channel

    def forward(self, x, img_size=(128, 128)):
        B, L, C = x.shape
        H = img_size[0]
        W = img_size[1]
        x = x.transpose(1, 2).contiguous().view(B, C, H, W)
        out = self.conv(x).flatten(2).transpose(1, 2).contiguous()
        return out

    def flops(self, H, W):
        flops = 0
        flops += H / 2 * W / 2 * self.in_channel * self.out_channel * 4 * 4
        print('Downsample:{%.2f}' % (flops / 1000000000.0))
        return flops


INIT_ARGS = {
    'in_channel': 3,
    'out_channel': 4,
}

ARGS = {
    'x': torch.randn(2, 16384, 3),
    'img_size': (128, 128),
}

if __name__ == '__main__':
    model = Downsample(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4096, 4) — shape (2, 4096, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GrayWorldRetinex Ran
ran on a synthesized input
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("9444a516e27f4c80")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class GrayWorldRetinex(nn.Module):

    def __init__(self, eps=1e-06):
        super(GrayWorldRetinex, self).__init__()
        self.eps = eps

    def forward(self, x):
        B, C, H, W = x.shape
        mean = x.mean(dim=(2, 3), keepdim=True)
        gray_mean = mean.mean(dim=1, keepdim=True)
        gain = gray_mean / (mean + self.eps)
        x = x * gain
        x_log = torch.log(x + self.eps)
        x_log = x_log - x_log.mean(dim=(2, 3), keepdim=True)
        x_out = torch.exp(x_log)
        x_min = x_out.amin(dim=(-2, -1), keepdim=True)
        x_max = x_out.amax(dim=(-2, -1), keepdim=True)
        x_out = (x_out - x_min) / (x_max - x_min + self.eps)
        return x_out


INIT_ARGS = {
    'eps': 1e-06
}

ARGS = {
    'x': torch.randn(2, 4, 3, 5)
}

if __name__ == '__main__':
    model = GrayWorldRetinex(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output range: [{output.min():.4f}, {output.max():.4f}]")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
LeFF Ran
ran on a synthesized input
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("63c6ae74544d6bf4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 12, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from einops import rearrange, repeat

INIT_ARGS = {
    'dim': 4,
    'hidden_dim': 16,
    'act_layer': nn.GELU,
    'drop': 0.0,
}

ARGS = {
    'x': torch.randn(2, 12, 4),
    'img_size': (3, 4),
}

if __name__ == '__main__':
    leff = nn.Module()
    leff.__class__ = type('LeFF', (nn.Module,), {
        '__init__': LeFF.__init__,
        'forward': LeFF.forward,
        'flops': LeFF.flops,
    })
    
    from einops import rearrange, repeat
    
    class LeFF(nn.Module):
        def __init__(self, dim=32, hidden_dim=128, act_layer=nn.GELU, drop=0.0):
            super().__init__()
            self.linear1 = nn.Sequential(nn.Linear(dim, hidden_dim), act_layer())
            self.dwconv = nn.Sequential(nn.Conv2d(hidden_dim, hidden_dim, groups=hidden_dim, kernel_size=3, stride=1, padding=1), act_layer())
            self.linear2 = nn.Sequential(nn.Linear(hidden_dim, dim))
            self.dim = dim
            self.hidden_dim = hidden_dim

        def forward(self, x, img_size=(128, 128)):
            bs, hw, c = x.size()
            hh = img_size[0]
            ww = img_size[1]
            x = self.linear1(x)
            x = rearrange(x, ' b (h w) (c) -> b c h w ', h=hh, w=ww)
            x = self.dwconv(x)
            x = rearrange(x, ' b c h w -> b (h w) c', h=hh, w=ww)
            x = self.linear2(x)
            return x

        def flops(self, H, W):
            flops = 0
            flops += H * W * self.dim * self.hidden_dim
            flops += H * W * self.hidden_dim * 3 * 3
            flops += H * W * self.hidden_dim * self.dim
            print('LeFF:{%.2f}' % (flops / 1000000000.0))
            return flops
    
    model = LeFF(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 12, 4) — shape (2, 12, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SepConv Ran
ran on a synthesized input
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("c07618e23803884f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 8, 5, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class SepConv(nn.Module):

    def __init__(self, in_channel, out_channel, kernel_size, stride=1, bias=True, padding_mode='zeros'):
        super().__init__()
        self.conv1 = nn.Conv2d(in_channel, in_channel, kernel_size, stride=stride, padding=kernel_size // 2, groups=in_channel, bias=bias, padding_mode=padding_mode)
        self.conv2 = nn.Conv2d(in_channel, out_channel, kernel_size=1, stride=1, padding=0, bias=bias)

    def forward(self, x):
        out = self.conv1(x)
        out = self.conv2(out)
        return out


INIT_ARGS = {
    'in_channel': 4,
    'out_channel': 8,
    'kernel_size': 3,
    'stride': 1,
    'bias': True,
    'padding_mode': 'zeros'
}

ARGS = {
    'x': torch.randn(2, 4, 5, 6)
}

if __name__ == '__main__':
    model = SepConv(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 8, 5, 6) — shape (2, 8, 5, 6) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Upsample Ran
ran on a synthesized input
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("14e0ff1eee13665d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 1024, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class Upsample(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(Upsample, self).__init__()
        self.deconv = nn.Sequential(nn.ConvTranspose2d(in_channel, out_channel, kernel_size=2, stride=2))
        self.in_channel = in_channel
        self.out_channel = out_channel

    def forward(self, x, img_size=(128, 128)):
        B, L, C = x.shape
        H = img_size[0]
        W = img_size[1]
        x = x.transpose(1, 2).contiguous().view(B, C, H, W)
        out = self.deconv(x)
        out = out.flatten(2).transpose(1, 2).contiguous()
        return out

    def flops(self, H, W):
        flops = 0
        flops += H * 2 * W * 2 * self.in_channel * self.out_channel * 2 * 2
        print('Upsample:{%.2f}' % (flops / 1000000000.0))
        return flops


INIT_ARGS = {
    'in_channel': 4,
    'out_channel': 8,
}

ARGS = {
    'x': torch.randn(2, 256, 4),
    'img_size': (16, 16),
}

if __name__ == '__main__':
    model = Upsample(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 1024, 8) — shape (2, 1024, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
WaveletEnhanceBlock Ran
ran on a synthesized input
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("fe03bb3075371634")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 8, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

class SepConv(nn.Module):

    def __init__(self, in_channel, out_channel, kernel_size, stride=1, bias=True, padding_mode='zeros'):
        super().__init__()
        self.conv1 = nn.Conv2d(in_channel, in_channel, kernel_size, stride=stride, padding=kernel_size // 2, groups=in_channel, bias=bias, padding_mode=padding_mode)
        self.conv2 = nn.Conv2d(in_channel, out_channel, kernel_size=1, stride=1, padding=0, bias=bias)

    def forward(self, x):
        out = self.conv1(x)
        out = self.conv2(out)
        return out

class WaveletEnhanceBlock(nn.Module):

    def __init__(self, channels):
        super().__init__()
        self.channels = channels
        ll = torch.tensor([[0.5, 0.5], [0.5, 0.5]])
        lh = torch.tensor([[-0.5, -0.5], [0.5, 0.5]])
        hl = torch.tensor([[-0.5, 0.5], [-0.5, 0.5]])
        hh = torch.tensor([[0.5, -0.5], [-0.5, 0.5]])
        kernel = torch.stack([ll, lh, hl, hh], dim=0).unsqueeze(1)
        kernel = kernel.repeat(channels, 1, 1, 1)
        self.register_buffer('haar_kernel', kernel)
        self.fuse = nn.Conv2d(4 * channels, channels, kernel_size=1, bias=False)
        self.post = SepConv(channels, channels, kernel_size=3, bias=False)

    def forward(self, x):
        B, C, H, W = x.shape
        dwt = F.conv2d(x, self.haar_kernel, stride=2, groups=C)
        fea = self.fuse(dwt)
        fea = self.post(fea)
        out = F.interpolate(fea, size=(H, W), mode='bilinear', align_corners=False)
        return out


INIT_ARGS = {
    'channels': 4
}

ARGS = {
    'x': torch.randn(2, 4, 8, 6)
}

if __name__ == '__main__':
    model = WaveletEnhanceBlock(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: {ARGS['x'].shape}")
    assert output.shape == ARGS['x'].shape, f"Shape mismatch: {output.shape} vs {ARGS['x'].shape}"
    print("Test passed!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 8, 6) — shape (2, 4, 8, 6) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
_rgb2luma_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("ab7ee232d170b209")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 1, 4, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a tensor of shape [B, 3, H, W]
# B=2 (batch), 3 (RGB channels), H=4, W=5 (distinct spatial dimensions)
x = torch.randn(2, 3, 4, 5)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 1, 4, 5) — shape (2, 1, 4, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
lambda_init_fn Ran
ran, honoured the contract we drafted
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("be9182dabbf2e31b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def lambda_init_fn(depth):
    return 0.8 - 0.6 * math.exp(-0.3 * depth)

ARGS = {
    "depth": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
window_partition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("d20e559930dd90c0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (8, 4, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Construct valid arguments for window_partition
# The function expects:
# - x: tensor of shape (B, H, W, C)
# - win_size: int, window size
# - dilation_rate: int, dilation rate (default=1)

B = 2
H = 8
W = 8
C = 4
win_size = 4
dilation_rate = 1

# Create a small input tensor with shape (B, H, W, C)
x = torch.randn(B, H, W, C)

ARGS = {
    'x': x,
    'win_size': win_size,
    'dilation_rate': dilation_rate
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (8, 4, 4, 4) — shape (8, 4, 4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
BasicShadowFormer Not yet run
unverified (harvested, no recorded run)
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("5bb8989bdacdba52")
How it ran

no invocation recorded.

CA_DWT_SIMTransformerBlock Not yet run
unverified (harvested, no recorded run)
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("78b92916b3439e60")
How it ran

no invocation recorded.

CA_DWT_TransformerBlock Not yet run
unverified (harvested, no recorded run)
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("b0d41218a8ed4956")
How it ran

no invocation recorded.

DifferentialWindowAttention Not yet run
unverified (harvested, no recorded run)
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("f9199808ce0cb924")
How it ran

no invocation recorded.

OutputProj Not yet run
unverified (harvested, no recorded run)
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("2bded9eead7cf113")
How it ran

no invocation recorded.

PhaSR Not yet run
unverified (harvested, no recorded run)
ming053l/PhaSR/model.py
code served (permissive licence) · get_code("099fdd7d22ce8e67")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 0 later) and 16 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
lambda_init_fn
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 the same month · 2 only as an assembly brick
2511.00833 (2025-11)
Linear Differential Vision Transformer: Learning Visual Contrasts via Pairwise Differentials
2601.17468 (2026-01)
ReflexSplit: Single Image Reflection Separation via Layer Fusion-Separation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Shadow removal under diverse lighting conditions requires disentangling illumination from intrinsic reflectance-a challenge compounded when physical priors are not properly aligned. We propose PhaSR (Physically Aligned Shadow Removal), addressing this through dual-level prior alignment to enable robust performance from single-light shadows to multi-source ambient lighting. First, Physically Aligned Normalization (PAN) performs closed-form illumination correction via Grayworld normalization, log-domain Retinex decomposition, and dynamic range recombination, suppressing chromatic bias. Second, Geometric-Semantic Rectification Attention (GSRA) extends differential attention to cross-modal alignment, harmonizing depth-derived geometry with DINO-v2 semantic embeddings to resolve modal conflicts under varying illumination. Experiments show competitive performance in shadow removal with lower complexity and generalization to ambient lighting where traditional methods fail under multi-source illumination. Our source code is available at https://github.com/ming053l/PhaSR.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2601.17470")
get_code_for_paper("2601.17470")
have("2601.17470")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2601.17470.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2601.17470.svg)](https://syntology.ai/paper/2601.17470)

Connect an agent — have() is free.